We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 122a084 + 90ff5c5 commit 26357eeCopy full SHA for 26357ee
lib/Sema/TypeCheckConstraints.cpp
@@ -2058,13 +2058,8 @@ TypeChecker::typeCheckExpression(
2058
2059
// Tell the constraint system what the contextual type is. This informs
2060
// diagnostics and is a hint for various performance optimizations.
2061
- // FIXME: Look through LoadExpr. This is an egregious hack due to the
2062
- // way typeCheckExprIndependently works.
2063
- Expr *contextualTypeExpr = expr;
2064
- if (auto loadExpr = dyn_cast_or_null<LoadExpr>(contextualTypeExpr))
2065
- contextualTypeExpr = loadExpr->getSubExpr();
2066
cs.setContextualType(
2067
- contextualTypeExpr,
+ expr,
2068
target.getExprContextualTypeLoc(),
2069
target.getExprContextualTypePurpose());
2070
0 commit comments