File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -623,16 +623,15 @@ bool ConstraintSystem::tryTypeVariableBindings(
623
623
<< " \n " ;
624
624
}
625
625
626
+ // If we were able to solve this without considering
627
+ // default literals, don't bother looking at default literals.
628
+ if (anySolved && binding.DefaultedProtocol && !sawFirstLiteralConstraint)
629
+ break ;
630
+
626
631
// Try to solve the system with typeVar := type
627
632
ConstraintSystem::SolverScope scope (*this );
628
633
if (binding.DefaultedProtocol ) {
629
- // If we were able to solve this without considering
630
- // default literals, don't bother looking at default literals.
631
- if (!sawFirstLiteralConstraint) {
632
- sawFirstLiteralConstraint = true ;
633
- if (anySolved)
634
- break ;
635
- }
634
+ sawFirstLiteralConstraint = true ;
636
635
type = openUnboundGenericType (type, typeVar->getImpl ().getLocator ());
637
636
type = type->reconstituteSugar (/* recursive=*/ false );
638
637
} else if (binding.BindingSource == ConstraintKind::ArgumentConversion &&
You can’t perform that action at this time.
0 commit comments