Skip to content

Commit 26357ee

Browse files
authored
Merge pull request swiftlang#30742 from LucianoPAlmeida/fixme-obsolete
[TypeChecker] Remove obsolete check for load expr on typeCheckExpr
2 parents 122a084 + 90ff5c5 commit 26357ee

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/Sema/TypeCheckConstraints.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -2058,13 +2058,8 @@ TypeChecker::typeCheckExpression(
20582058

20592059
// Tell the constraint system what the contextual type is. This informs
20602060
// 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();
20662061
cs.setContextualType(
2067-
contextualTypeExpr,
2062+
expr,
20682063
target.getExprContextualTypeLoc(),
20692064
target.getExprContextualTypePurpose());
20702065

0 commit comments

Comments
 (0)