Skip to content

Commit bb55d6c

Browse files
committed
Update assert
We previously asserted that a variable contained a FileUnit, but the intention of this was to separate it from SourceFiles, and SourceFile is a subtype of FileUnit, so it wouldn't trigger if the variable actually contained a SourceFile.
1 parent cfe7c0c commit bb55d6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/TypeCheckMacros.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ static SourceFile *evaluateAttachedMacro(MacroDecl *macro, Decl *attachedTo,
13801380
attachedTo->getDeclContext()->getModuleScopeContext()));
13811381
dc = attachedTo->getDeclContext();
13821382
// decls imported from clang do not have a SourceFile
1383-
assert(isa<FileUnit>(dc));
1383+
assert(isa<FileUnit>(dc) && !isa<SourceFile>(dc));
13841384
}
13851385
} else {
13861386
dc = attachedTo->getInnermostDeclContext();

0 commit comments

Comments
 (0)