File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -4706,7 +4706,7 @@ class ConstraintSystem {
47064706 SmallVector<PotentialBinding, 4 > Bindings;
47074707
47084708 // / The set of protocol requirements placed on this type variable.
4709- llvm::TinyPtrVector <Constraint *> Protocols;
4709+ llvm::SmallVector <Constraint *, 4 > Protocols;
47104710
47114711 // / The set of constraints which would be used to infer default types.
47124712 llvm::TinyPtrVector<Constraint *> Defaults;
Original file line number Diff line number Diff line change @@ -986,8 +986,13 @@ bool ConstraintSystem::PotentialBindings::infer(
986986 break ;
987987
988988 case ConstraintKind::ConformsTo:
989- case ConstraintKind::SelfObjectOfProtocol:
990- return false ;
989+ case ConstraintKind::SelfObjectOfProtocol: {
990+ auto protocolTy = constraint->getSecondType ();
991+ if (!protocolTy->is <ProtocolType>())
992+ return false ;
993+
994+ LLVM_FALLTHROUGH;
995+ }
991996
992997 case ConstraintKind::LiteralConformsTo: {
993998 // Record constraint where protocol requirement originated
You can’t perform that action at this time.
0 commit comments