mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Solve Bind constraints involving to two variables of different lvalue-ness
The restriction here only applies to Equal constraints. Fixes <rdar://problem/45511838>, <https://bugs.swift.org/browse/SR-9068>.
This commit is contained in:
@@ -1730,7 +1730,8 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
|
||||
|
||||
// If exactly one of the type variables can bind to an lvalue, we
|
||||
// can't merge these two type variables.
|
||||
if (rep1->getImpl().canBindToLValue()
|
||||
if (kind == ConstraintKind::Equal &&
|
||||
rep1->getImpl().canBindToLValue()
|
||||
!= rep2->getImpl().canBindToLValue())
|
||||
return formUnsolvedResult();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user