mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Fix for accidental desugaring in simplifyType()
When called with a ParenType wrapping a DependentMemberType, we would drop the ParenType because we used type->getAs<ParenType>() rather than dyn_cast<ParenType>(type.getPointer()). This fixes an existing QoI issue with closure argument tuples, and prevents another regression once SubstitutedType is removed.
This commit is contained in:
@@ -1513,7 +1513,7 @@ Type ConstraintSystem::simplifyType(Type type) {
|
||||
|
||||
// If this is a dependent member type for which we end up simplifying
|
||||
// the base to a non-type-variable, perform lookup.
|
||||
if (auto depMemTy = type->getAs<DependentMemberType>()) {
|
||||
if (auto depMemTy = dyn_cast<DependentMemberType>(type.getPointer())) {
|
||||
// Simplify the base.
|
||||
Type newBase = simplifyType(depMemTy->getBase());
|
||||
if (!newBase) return type;
|
||||
@@ -1586,7 +1586,7 @@ Type Solution::simplifyType(TypeChecker &tc, Type type) const {
|
||||
|
||||
// If this is a dependent member type for which we end up simplifying
|
||||
// the base to a non-type-variable, perform lookup.
|
||||
if (auto depMemTy = type->getAs<DependentMemberType>()) {
|
||||
if (auto depMemTy = dyn_cast<DependentMemberType>(type.getPointer())) {
|
||||
// Simplify the base.
|
||||
Type newBase = simplifyType(tc, depMemTy->getBase());
|
||||
if (!newBase) return type;
|
||||
|
||||
Reference in New Issue
Block a user