mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CSBindings] Open collection before binding parameter only if original argument type failed
Instead of always opening argument type represented by a collection without type variables (to support subtyping when element is a labeled tuple), let's try original type first and if that fails use a slower path with indirection which attempts `array upcast`. Doing it this way helps to propagate contextual information faster which fixes a performance regression. Resolves: rdar://problem/54580247
This commit is contained in:
@@ -3799,9 +3799,11 @@ bool ConstraintSystem::repairFailures(
|
||||
if (tupleLocator->isLastElement<LocatorPathElt::SequenceElementType>())
|
||||
break;
|
||||
|
||||
// Generic argument failures have a more general fix which is attached to a
|
||||
// parent type and aggregates all argument failures into a single fix.
|
||||
if (tupleLocator->isLastElement<LocatorPathElt::GenericArgument>())
|
||||
// Generic argument/requirement failures have a more general fix which
|
||||
// is attached to a parent type and aggregates all argument failures
|
||||
// into a single fix.
|
||||
if (tupleLocator->isLastElement<LocatorPathElt::AnyRequirement>() ||
|
||||
tupleLocator->isLastElement<LocatorPathElt::GenericArgument>())
|
||||
break;
|
||||
|
||||
ConstraintFix *fix;
|
||||
|
||||
Reference in New Issue
Block a user