Skip to content

Commit eea7ab3

Browse files
committed
AST: Make certain behavior of checkRequirement() explicit
checkConformanceWithoutContext() calls checkRequirement() with type parameters and expects it to return false.
1 parent ffba6d1 commit eea7ab3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/AST/Requirement.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ CheckRequirementResult Requirement::checkRequirement(
112112
}
113113

114114
auto *proto = getProtocolDecl();
115+
116+
if (firstType->isTypeParameter())
117+
return CheckRequirementResult::RequirementFailure;
118+
115119
auto conformance = ModuleDecl::lookupConformance(
116120
firstType, proto, allowMissing);
117121
if (!conformance)

0 commit comments

Comments
 (0)