[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:
Doug Gregor
2017-06-20 23:46:55 -07:00
parent c21699b4e5
commit a570a5a15e
2 changed files with 25 additions and 2 deletions

View File

@@ -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>();