Skip to content

Commit 6934046

Browse files
committed
Serialization: Fix associated conformance deserialization for EnableDeserializationRecovery
This was using the wrong predicate. Make it consistent with type witness deserialization.
1 parent 95274b1 commit 6934046

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8256,7 +8256,7 @@ void ModuleFile::finishNormalConformance(NormalProtocolConformance *conformance,
82568256
auto maybeConformance = getConformanceChecked(conformanceID);
82578257
if (maybeConformance) {
82588258
reqConformances.push_back(maybeConformance.get());
8259-
} else if (allowCompilerErrors()) {
8259+
} else if (getContext().LangOpts.EnableDeserializationRecovery) {
82608260
diagnoseAndConsumeError(maybeConformance.takeError());
82618261
reqConformances.push_back(ProtocolConformanceRef::forInvalid());
82628262
} else {

test/Serialization/Recovery/protocol-requirement-in-implementation-only.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %empty-directory(%t)
22

3-
// XFAIL: noncopyable_generics
4-
53
//// Build the private module and the public module normally.
64
//// Force the public module to be system with an underlying Clang module.
75
// RUN: %target-swift-frontend -emit-module -DPRIVATE_LIB %s -module-name private_lib -emit-module-path %t/private_lib.swiftmodule
@@ -12,7 +10,7 @@
1210

1311
#if PRIVATE_LIB
1412

15-
public struct HiddenStruct {
13+
public struct HiddenStruct: Equatable {
1614
public init() {}
1715
}
1816

@@ -21,7 +19,9 @@ public struct HiddenStruct {
2119
@_implementationOnly import private_lib
2220

2321
protocol SomeProtocol {
24-
associatedtype Value
22+
// Make sure we recover from failure when reading the type witness and
23+
// associated conformance.
24+
associatedtype Value: Equatable
2525
static var defaultValue: Value { get }
2626
}
2727
public struct M: SomeProtocol {

0 commit comments

Comments
 (0)