File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2063,7 +2063,7 @@ static void diagnoseConformanceImpliedByConditionalConformance(
2063
2063
auto proto = conformance->getProtocol ();
2064
2064
Type protoType = proto->getDeclaredInterfaceType ();
2065
2065
auto implyingProto = implyingConf->getProtocol ()->getDeclaredInterfaceType ();
2066
- auto loc = implyingConf->getLoc ( );
2066
+ auto loc = extractNearestSourceLoc ( implyingConf->getDeclContext () );
2067
2067
Diags.diagnose (loc, diag::conditional_conformances_cannot_imply_conformances,
2068
2068
conformance->getType (), implyingProto, protoType);
2069
2069
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import APINotesFrameworkTest
9
9
10
10
// CHECK-DIAGS-5-NOT: versioned-objc.swift:[[@LINE-1]]:
11
11
class ProtoWithVersionedUnavailableMemberImpl : ProtoWithVersionedUnavailableMember {
12
- // CHECK-DIAGS-4: versioned-objc.swift:[[@LINE-1]]:7 : error: type 'ProtoWithVersionedUnavailableMemberImpl' cannot conform to protocol 'ProtoWithVersionedUnavailableMember' because it has requirements that cannot be satisfied
12
+ // CHECK-DIAGS-4: versioned-objc.swift:[[@LINE-1]]:48 : error: type 'ProtoWithVersionedUnavailableMemberImpl' cannot conform to protocol 'ProtoWithVersionedUnavailableMember' because it has requirements that cannot be satisfied
13
13
func requirement( ) -> Any ? { return nil }
14
14
}
15
15
Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ protocol StrictlyLocal {
106
106
}
107
107
108
108
distributed actor Nope1_StrictlyLocal : StrictlyLocal {
109
+ // expected-note@-1{{add '@preconcurrency' to the 'StrictlyLocal' conformance to suppress isolation-related diagnostics}}
110
+
109
111
func local( ) { }
110
112
// expected-error@-1{{distributed actor-isolated instance method 'local()' cannot be used to satisfy nonisolated protocol requirement}}
111
113
// expected-note@-2{{add 'nonisolated' to 'local()' to make this instance method not isolated to the actor}}
@@ -157,6 +159,8 @@ actor LocalOK_ImplicitlyThrowsAsync_AsyncThrowsAll: AsyncThrowsAll {
157
159
}
158
160
159
161
distributed actor Nope1_AsyncThrowsAll : AsyncThrowsAll {
162
+ // expected-note@-1{{add '@preconcurrency' to the 'AsyncThrowsAll' conformance to suppress isolation-related diagnostics}}
163
+
160
164
func maybe( param: String , int: Int ) async throws -> Int { 111 }
161
165
// expected-error@-1{{distributed actor-isolated instance method 'maybe(param:int:)' cannot be used to satisfy nonisolated protocol requirement}}
162
166
// expected-note@-2{{add 'nonisolated' to 'maybe(param:int:)' to make this instance method not isolated to the actor}}
@@ -202,6 +206,8 @@ func test_watching_A(a: A_TerminationWatchingA) async throws {
202
206
}
203
207
204
208
distributed actor DA_TerminationWatchingA : TerminationWatchingA {
209
+ // expected-note@-1{{add '@preconcurrency' to the 'TerminationWatchingA' conformance to suppress isolation-related diagnostics}}
210
+
205
211
func terminated( a: String ) { }
206
212
// expected-error@-1{{distributed actor-isolated instance method 'terminated(a:)' cannot be used to satisfy nonisolated protocol requirement}}
207
213
// expected-note@-2{{add 'nonisolated' to 'terminated(a:)' to make this instance method not isolated to the actor}}
You can’t perform that action at this time.
0 commit comments