Skip to content

Commit ce68190

Browse files
authored
Merge pull request #14789 from rudkx/fix-constraint-dumping
2 parents 7c905d3 + 587fde5 commit ce68190

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,9 +1380,15 @@ ConstraintSystem::solve(Expr *&expr,
13801380
}
13811381

13821382
if (TC.getLangOpts().DebugConstraintSolver) {
1383-
auto getTypeOfExpr = [&](const Expr *E) -> Type { return getType(E); };
1383+
auto getTypeOfExpr = [&](const Expr *E) -> Type {
1384+
if (hasType(E))
1385+
return getType(E);
1386+
return Type();
1387+
};
13841388
auto getTypeOfTypeLoc = [&](const TypeLoc &TL) -> Type {
1385-
return getType(TL);
1389+
if (hasType(TL))
1390+
return getType(TL);
1391+
return Type();
13861392
};
13871393

13881394
auto &log = getASTContext().TypeCheckerDebug->getStream();

0 commit comments

Comments
 (0)