Skip to content

Commit abd15af

Browse files
committed
ASTVerifier: Dump expression in checkTrivialSubtype()
1 parent aa87afd commit abd15af

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/AST/ASTVerifier.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@ class Verifier : public ASTWalker {
14161416
abort();
14171417
}
14181418

1419-
checkTrivialSubtype(srcTy, destTy, "MetatypeConversionExpr");
1419+
checkTrivialSubtype(E, srcTy, destTy, "MetatypeConversionExpr");
14201420
verifyCheckedBase(E);
14211421
}
14221422

@@ -1641,7 +1641,7 @@ class Verifier : public ASTWalker {
16411641
abort();
16421642
}
16431643

1644-
checkTrivialSubtype(srcTy, destTy, "DerivedToBaseExpr");
1644+
checkTrivialSubtype(E, srcTy, destTy, "DerivedToBaseExpr");
16451645
verifyCheckedBase(E);
16461646
}
16471647

@@ -3590,12 +3590,14 @@ class Verifier : public ASTWalker {
35903590
abort();
35913591
}
35923592

3593-
void checkTrivialSubtype(Type srcTy, Type destTy, const char *what) {
3593+
void checkTrivialSubtype(Expr *E, Type srcTy, Type destTy,
3594+
const char *what) {
35943595
if (srcTy->isEqual(destTy)) return;
35953596

35963597
if (auto srcMetatype = srcTy->getAs<AnyMetatypeType>()) {
35973598
if (auto destMetatype = destTy->getAs<AnyMetatypeType>()) {
3598-
return checkTrivialSubtype(srcMetatype->getInstanceType(),
3599+
return checkTrivialSubtype(E,
3600+
srcMetatype->getInstanceType(),
35993601
destMetatype->getInstanceType(),
36003602
what);
36013603
}
@@ -3625,6 +3627,7 @@ class Verifier : public ASTWalker {
36253627
Out << " to ";
36263628
destTy.print(Out);
36273629
Out << "\n";
3630+
E->dump(Out);
36283631
abort();
36293632
}
36303633

0 commit comments

Comments
 (0)