Skip to content

Commit 3afb498

Browse files
committed
[Deserialization] Do not assert on a missing witness if allowing errors
When allowing errors we may have serialized a requirement without a witness, do not assert when deserializing. Resolves rdar://81884767
1 parent 86c7245 commit 3afb498

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6556,8 +6556,8 @@ void ModuleFile::finishNormalConformance(NormalProtocolConformance *conformance,
65566556
} else {
65576557
fatal(deserializedWitness.takeError());
65586558
}
6559-
6560-
assert(!req || isOpaque || witness ||
6559+
6560+
assert(allowCompilerErrors() || !req || isOpaque || witness ||
65616561
req->getAttrs().hasAttribute<OptionalAttr>() ||
65626562
req->getAttrs().isUnavailable(getContext()));
65636563
if (!witness && !isOpaque) {
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// RUN: %empty-directory(%t)
22

3-
// RUN: %target-swift-frontend -module-name errors -emit-module -o %t/errors.swiftmodule -experimental-allow-module-with-compiler-errors %s
3+
// RUN: %target-swift-frontend -module-name errors -emit-module -o %t/errors.partial.swiftmodule -experimental-allow-module-with-compiler-errors %s
4+
// RUN: %target-swift-frontend -merge-modules -module-name errors -emit-module -o %t/errors.swiftmodule -experimental-allow-module-with-compiler-errors %t/errors.partial.swiftmodule
45

56
public protocol SomeProto {
67
init(from: SomeProto)
78
}
89

9-
struct A {}
10-
struct B: SomeProto {
10+
public struct A {}
11+
public struct B: SomeProto {
1112
let a: A
1213
}
1314

14-
let thing = B(a: A())
15+
public let thing = B(a: A())

0 commit comments

Comments
 (0)