Skip to content

Commit 8125e60

Browse files
committed
NFC: add a few module asserts
1 parent 9a6027d commit 8125e60

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,7 @@ class PrintAST : public ASTVisitor<PrintAST> {
10931093
Type OldType = CurrentType;
10941094
if (CurrentType && (Old != nullptr || Options.PrintAsMember)) {
10951095
if (auto *NTD = dyn_cast<NominalTypeDecl>(D)) {
1096+
assert(Options.CurrentModule);
10961097
auto Subs = CurrentType->getContextSubstitutionMap(
10971098
Options.CurrentModule, NTD->getDeclContext());
10981099
setCurrentType(NTD->getDeclaredInterfaceType().subst(Subs));

lib/AST/TypeSubstitution.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ operator()(CanType dependentType, Type conformingReplacementType,
211211
if (conformingReplacementType->isTypeParameter())
212212
return ProtocolConformanceRef(conformedProtocol);
213213

214+
assert(M && "null module in conformance lookup");
214215
return M->lookupConformance(conformingReplacementType,
215216
conformedProtocol,
216217
/*allowMissing=*/true);

0 commit comments

Comments
 (0)