mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
TBDGen: Avoid crash when value witness is missing in conformance.
This commit is contained in:
@@ -287,6 +287,9 @@ class SILSymbolVisitorImpl : public ASTVisitor<SILSymbolVisitorImpl> {
|
||||
rootConformance->forEachValueWitness([&](ValueDecl *valueReq,
|
||||
Witness witness) {
|
||||
auto witnessDecl = witness.getDecl();
|
||||
if (!witnessDecl)
|
||||
return;
|
||||
|
||||
if (isa<AbstractFunctionDecl>(valueReq)) {
|
||||
addSymbolIfNecessary(valueReq, witnessDecl);
|
||||
} else if (auto *storage = dyn_cast<AbstractStorageDecl>(valueReq)) {
|
||||
|
||||
10
test/TBD/lazy-typecheck-bad-conformance.swift
Normal file
10
test/TBD/lazy-typecheck-bad-conformance.swift
Normal file
@@ -0,0 +1,10 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -typecheck -experimental-lazy-typecheck -emit-tbd -emit-tbd-path %t/lazy.tbd %s -enable-library-evolution -parse-as-library
|
||||
|
||||
public protocol P {
|
||||
func req()
|
||||
}
|
||||
|
||||
// FIXME: This malformed conformance should probably be diagnosed.
|
||||
public struct S: P {
|
||||
}
|
||||
Reference in New Issue
Block a user