Skip to content

Commit 8ba30d7

Browse files
committed
REPL: Remove use of typeCheckExpressionShallow()
It's easy enough to just directly construct a well-typed CallExpr here.
1 parent 1283b54 commit 8ba30d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Sema/TypeCheckREPL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ void REPLChecker::generatePrintOfExpression(StringRef NameStr, Expr *E) {
268268
CE->setBody(Body, false);
269269
TC.typeCheckClosureBody(CE);
270270

271-
Expr *TheCall = CallExpr::createImplicit(Context, CE, { E }, { });
272-
if (TC.typeCheckExpressionShallow(TheCall, Arg->getDeclContext()))
273-
return ;
271+
auto *TheCall = CallExpr::createImplicit(Context, CE, { E }, { });
272+
TheCall->getArg()->setType(ParenType::get(Context, E->getType()));
273+
TheCall->setType(Context.TheEmptyTupleType);
274274

275275
// Inject the call into the top level stream by wrapping it with a TLCD.
276276
auto *BS = BraceStmt::create(Context, Loc, ASTNode(TheCall),

0 commit comments

Comments
 (0)