File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -554,8 +554,16 @@ bool IsDeclRefinementOfRequest::evaluate(Evaluator &evaluator,
554
554
substTypeB = substTypeB->substituteBindingsTo (substTypeA,
555
555
[&](ArchetypeType *origType, CanType substType,
556
556
ArchetypeType *, ArrayRef<ProtocolConformanceRef>) -> CanType {
557
- auto interfaceTy = origType->getInterfaceType ()->getCanonicalType ();
558
- substMap[interfaceTy->getAs <SubstitutableType>()] = substType;
557
+ auto interfaceTy =
558
+ origType->getInterfaceType ()->getCanonicalType ()->getAs <SubstitutableType>();
559
+
560
+ // Make sure any duplicate bindings are equal to the one already recorded.
561
+ // Otherwise, the substition has conflicting generic arguments.
562
+ auto bound = substMap.find (interfaceTy);
563
+ if (bound != substMap.end () && !bound->second ->isEqual (substType))
564
+ return CanType ();
565
+
566
+ substMap[interfaceTy] = substType;
559
567
return substType;
560
568
});
561
569
You can’t perform that action at this time.
0 commit comments