Skip to content

Commit 1ee30a3

Browse files
committed
[Type checker diags] Check generic arguments for any generic function.
This includes functions without type parameters that are generic because they are members of a generic context. This addresses a diagnostics regression because the '==' operators for Optional, Array, and Dictionary were made into members. The resulting error message is a little ugly, but is more informative (and much shorter) than what we had before.
1 parent 940ecda commit 1ee30a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4844,7 +4844,7 @@ bool FailureDiagnosis::diagnoseArgumentGenericRequirements(
48444844
AFD = dyn_cast<AbstractFunctionDecl>(candidate);
48454845
}
48464846

4847-
if (!AFD || !AFD->isGeneric() || !AFD->hasInterfaceType())
4847+
if (!AFD || !AFD->getGenericSignature() || !AFD->hasInterfaceType())
48484848
return false;
48494849

48504850
auto env = AFD->getGenericEnvironment();

0 commit comments

Comments
 (0)