Skip to content

Commit 2adad14

Browse files
committed
RequirementMachine: Don't call getContextSubstitutionMap() on an existential type
1 parent 4954278 commit 2adad14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/AST/RequirementMachine/RequirementLowering.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,9 @@ struct InferRequirementsWalker : public TypeWalker {
637637
}
638638
}
639639

640-
if (!ty->isSpecialized())
640+
// Both is<ExistentialType>() and isSpecialized() end up being true if we
641+
// have invalid code where a protocol is nested inside a generic nominal.
642+
if (ty->is<ExistentialType>() || !ty->isSpecialized())
641643
return Action::Continue;
642644

643645
// Infer from generic nominal types.

0 commit comments

Comments
 (0)