File tree 3 files changed +13
-10
lines changed
3 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -3247,6 +3247,18 @@ namespace {
3247
3247
auto toType = simplifyType (cs.getType (expr));
3248
3248
ASSERT (toType->isEqual (expr->getParamDecl ()->getValueType ()));
3249
3249
cs.setType (expr, toType);
3250
+
3251
+ auto declRefRepr = cast<DeclRefTypeRepr>(expr->getRepr ());
3252
+ auto resolvedTy =
3253
+ TypeResolution::resolveContextualType (declRefRepr, cs.DC ,
3254
+ TypeResolverContext::InExpression,
3255
+ nullptr , nullptr , nullptr );
3256
+
3257
+ if (!resolvedTy || resolvedTy->hasError ())
3258
+ return nullptr ;
3259
+
3260
+ expr->setParamType (resolvedTy);
3261
+
3250
3262
return expr;
3251
3263
}
3252
3264
Original file line number Diff line number Diff line change @@ -1723,15 +1723,6 @@ namespace {
1723
1723
}
1724
1724
1725
1725
Type visitTypeValueExpr (TypeValueExpr *E) {
1726
- auto declRefRepr = cast<DeclRefTypeRepr>(E->getRepr ());
1727
- auto resolvedTy = resolveTypeReferenceInExpression (declRefRepr,
1728
- TypeResolverContext::InExpression,
1729
- CS.getConstraintLocator (E));
1730
-
1731
- if (!resolvedTy || resolvedTy->hasError ())
1732
- return Type ();
1733
-
1734
- E->setParamType (resolvedTy);
1735
1726
return E->getParamDecl ()->getValueType ();
1736
1727
}
1737
1728
Original file line number Diff line number Diff line change @@ -2340,7 +2340,7 @@ TypeExpr *PreCheckTarget::simplifyTypeExpr(Expr *E) {
2340
2340
2341
2341
// When simplifying a type expr like "P1 & P2 -> P3 & P4 -> Int",
2342
2342
// it may have been folded at the same time; recursively simplify it.
2343
- if (auto ArgsTypeExpr = simplifyTypeExpr (E))
2343
+ if (auto ArgsTypeExpr = simplifyTypeExpr (E))
2344
2344
return ArgsTypeExpr->getTypeRepr ();
2345
2345
return nullptr ;
2346
2346
};
You can’t perform that action at this time.
0 commit comments