We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 880a143 commit 28f5c57Copy full SHA for 28f5c57
lib/Sema/CSApply.cpp
@@ -6178,8 +6178,15 @@ static bool applyTypeToClosureExpr(ConstraintSystem &cs,
6178
Expr *expr, Type toType) {
6179
// Look through identity expressions, like parens.
6180
if (auto IE = dyn_cast<IdentityExpr>(expr)) {
6181
- if (!applyTypeToClosureExpr(cs, IE->getSubExpr(), toType)) return false;
6182
- cs.setType(IE, toType);
+ if (!applyTypeToClosureExpr(cs, IE->getSubExpr(), toType))
+ return false;
6183
+
6184
+ auto subExprTy = cs.getType(IE->getSubExpr());
6185
+ if (isa<ParenExpr>(IE)) {
6186
+ cs.setType(IE, ParenType::get(cs.getASTContext(), subExprTy));
6187
+ } else {
6188
+ cs.setType(IE, subExprTy);
6189
+ }
6190
return true;
6191
}
6192
0 commit comments