mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CSSolver/SILGen] Fix solver to support function conversion with collection subtyping
Fix collection subtyping relation in function argument position by emiting special re-abstraction thunk with collection upcast. Resolves: rdar://problem/35702810
This commit is contained in:
@@ -2090,8 +2090,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
|
||||
}
|
||||
|
||||
// Special implicit nominal conversions.
|
||||
if (!type1->is<LValueType>() &&
|
||||
kind >= ConstraintKind::Conversion) {
|
||||
if (!type1->is<LValueType>() && kind >= ConstraintKind::Subtype) {
|
||||
// Array -> Array.
|
||||
if (isArrayType(desugar1) && isArrayType(desugar2)) {
|
||||
assert(!type2->is<LValueType>() && "Unexpected lvalue type!");
|
||||
|
||||
Reference in New Issue
Block a user