Skip to content

Commit 175d0ba

Browse files
committed
Serialization: Minor improvements to the error on conformance mismatch
Clarify the sources of information when a conformance reference in a swiftmodule doesn't match with the requirements seen by the reader.
1 parent 5e952e9 commit 175d0ba

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,8 +1092,8 @@ NOTE(modularization_issue_conformance_xref_note,none,
10921092
"Breaks conformances of '%0' to %1",
10931093
(StringRef, DeclName))
10941094
ERROR(modularization_issue_conformance_error,none,
1095-
"Conformances of '%0' "
1096-
"do not match requirement signature of %1; "
1095+
"Listed conformances of '%0' "
1096+
"do not match current requirement signature of %1; "
10971097
"%2 conformances for %3 requirements",
10981098
(StringRef, DeclName, unsigned int, unsigned int))
10991099

lib/Serialization/Deserialization.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9119,13 +9119,13 @@ void ModuleFile::finishNormalConformance(NormalProtocolConformance *conformance,
91199119

91209120
// Print context to stderr.
91219121
PrintOptions Opts;
9122-
llvm::errs() << "Requirements:\n";
9122+
llvm::errs() << "Requirements seen by this invocation:\n";
91239123
for (auto req: requirements) {
91249124
req.print(llvm::errs(), Opts);
91259125
llvm::errs() << "\n";
91269126
}
91279127

9128-
llvm::errs() << "Conformances:\n";
9128+
llvm::errs() << "\nConformances written in the swiftmodule:\n";
91299129
for (auto req: reqConformances) {
91309130
req.print(llvm::errs());
91319131
llvm::errs() << "\n";

test/Serialization/Recovery/conformance-xref.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ extension Counter: SimpleProto {}
6262
public protocol ProtoUser {
6363
associatedtype Element
6464
#if DROP_REQUIREMENT
65-
// CHECK-REMARK-REQUIREMENT: MiddleLib.swiftmodule:1:1: error: Conformances of 'OneToAThousand' do not match requirement signature of 'ProtoUser'; 5 conformances for 6 requirements
66-
// CHECK-REMARK-REQUIREMENT: Requirements:
65+
// CHECK-REMARK-REQUIREMENT: MiddleLib.swiftmodule:1:1: error: Listed conformances of 'OneToAThousand' do not match current requirement signature of 'ProtoUser'; 5 conformances for 6 requirements
66+
// CHECK-REMARK-REQUIREMENT: Requirements seen by this invocation:
6767
// Skipping implicits.
68-
// CHECK-REMARK-REQUIREMENT: Conformances:
68+
// CHECK-REMARK-REQUIREMENT: Conformances written in the swiftmodule:
6969
// Skipping implicits.
7070
// CHECK-REMARK-REQUIREMENT: (specialized_conformance type="OneToAThousand.Impl" protocol="SimpleProto"
7171
// CHECK-REMARK-REQUIREMENT: (normal_conformance type="Counter<T>" protocol="SimpleProto"{{.*}} lazy))

0 commit comments

Comments
 (0)