mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Type checker] Check type equality even for argument tuples in Swift 4.
Replace a where Type-pointer-equality check with what it intended, i.e., match up ParenTypes at the top level and perform a deeper equality comparison of the underlying types. Fixes SR-5166 / rdar://problem/32666189.
This commit is contained in:
@@ -1384,7 +1384,9 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
|
||||
typeVar2 = dyn_cast<TypeVariableType>(type2.getPointer());
|
||||
|
||||
// If the types are obviously equivalent, we're done.
|
||||
if (type1.getPointer() == type2.getPointer())
|
||||
if (isa<ParenType>(type1.getPointer()) ==
|
||||
isa<ParenType>(type2.getPointer()) &&
|
||||
type1->isEqual(type2))
|
||||
return SolutionKind::Solved;
|
||||
} else {
|
||||
typeVar1 = desugar1->getAs<TypeVariableType>();
|
||||
|
||||
Reference in New Issue
Block a user