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 {
4706
4706
SmallVector<PotentialBinding, 4 > Bindings;
4707
4707
4708
4708
// / The set of protocol requirements placed on this type variable.
4709
- llvm::TinyPtrVector <Constraint *> Protocols;
4709
+ llvm::SmallVector <Constraint *, 4 > Protocols;
4710
4710
4711
4711
// / The set of constraints which would be used to infer default types.
4712
4712
llvm::TinyPtrVector<Constraint *> Defaults;
Original file line number Diff line number Diff line change @@ -986,8 +986,13 @@ bool ConstraintSystem::PotentialBindings::infer(
986
986
break ;
987
987
988
988
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
+ }
991
996
992
997
case ConstraintKind::LiteralConformsTo: {
993
998
// Record constraint where protocol requirement originated
You can’t perform that action at this time.
0 commit comments