Skip to content

Commit 02ba2d3

Browse files
author
Harlan Haskins
authored
Merge pull request #25373 from harlanhaskins/extensify
[Sema] Bail early in exportability checker if there's no extended type
2 parents 69c05c0 + 2aa0a71 commit 02ba2d3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/Sema/TypeCheckAccess.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,12 @@ class ExportabilityChecker : public DeclVisitor<ExportabilityChecker> {
18721872
}
18731873

18741874
void visitExtensionDecl(ExtensionDecl *ED) {
1875-
if (shouldSkipChecking(ED->getExtendedNominal()))
1875+
auto extendedType = ED->getExtendedNominal();
1876+
// TODO: Sometimes we have an extension that is marked valid but has no
1877+
// extended type. Assert, just in case we see it while testing, but
1878+
// don't crash. rdar://50401284
1879+
assert(extendedType && "valid extension with no extended type?");
1880+
if (!extendedType || shouldSkipChecking(extendedType))
18761881
return;
18771882

18781883
// FIXME: We should allow conforming to implementation-only protocols,

0 commit comments

Comments
 (0)