Skip to content

Commit 391277c

Browse files
authored
Merge pull request #77576 from tshortli/tbdgen-lazy-typecheck-bad-extension
SIL: Skip visiting bad extensions in SILSymbolVisitor
2 parents 01ed36d + 74035ac commit 391277c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/SIL/IR/SILSymbolVisitor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,9 @@ class SILSymbolVisitorImpl : public ASTVisitor<SILSymbolVisitorImpl> {
735735

736736
void visitExtensionDecl(ExtensionDecl *ED) {
737737
auto nominal = ED->getExtendedNominal();
738+
if (!nominal)
739+
return;
740+
738741
if (canSkipNominal(nominal))
739742
return;
740743

test/TBD/lazy-typecheck-bad-conformance.swift renamed to test/TBD/lazy-typecheck-errors.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ public protocol P {
88
// expected-error@+1 {{type 'S' does not conform to protocol 'P'}}
99
public struct S: P {
1010
}
11+
12+
extension DoesNotExist {
13+
public func method() {}
14+
}

0 commit comments

Comments
 (0)