File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -3918,8 +3918,15 @@ bool ConstraintSystem::generateConstraints(
3918
3918
3919
3919
// / Generate constraints for each pattern binding entry
3920
3920
for (unsigned index : range (patternBinding->getNumPatternEntries ())) {
3921
- // Type check the pattern.
3922
- auto pattern = patternBinding->getPattern (index);
3921
+ auto *pattern = TypeChecker::resolvePattern (
3922
+ patternBinding->getPattern (index), dc, /* isStmtCondition=*/ true );
3923
+
3924
+ if (!pattern)
3925
+ return true ;
3926
+
3927
+ // Type check the pattern. Note use of `forRawPattern` here instead
3928
+ // of `forPatternBindingDecl` because resolved `pattern` is not
3929
+ // associated with `patternBinding`.
3923
3930
auto contextualPattern = ContextualPattern::forRawPattern (pattern, dc);
3924
3931
Type patternType = TypeChecker::typeCheckPattern (contextualPattern);
3925
3932
You can’t perform that action at this time.
0 commit comments