Skip to content

Commit 38a6d88

Browse files
committed
[ConstraintSystem] ConstraintLocator: Implement printing of decl anchors
1 parent 4d501ef commit 38a6d88

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8002,6 +8002,16 @@ void constraints::dumpAnchor(ASTNode anchor, SourceManager *SM,
80028002
out << '@';
80038003
pattern->getLoc().print(out, *SM);
80048004
}
8005+
} else if (auto *decl = anchor.dyn_cast<Decl *>()) {
8006+
if (auto *VD = dyn_cast<ValueDecl>(decl)) {
8007+
VD->dumpRef(out);
8008+
} else {
8009+
out << "<<" << Decl::getKindName(decl->getKind()) << ">>";
8010+
if (SM) {
8011+
out << "@";
8012+
decl->getLoc().print(out, *SM);
8013+
}
8014+
}
80058015
}
80068016
// TODO(diagnostics): Implement the rest of the cases.
80078017
}

0 commit comments

Comments
 (0)