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(
20632063  auto  proto = conformance->getProtocol ();
20642064  Type protoType = proto->getDeclaredInterfaceType ();
20652065  auto  implyingProto = implyingConf->getProtocol ()->getDeclaredInterfaceType ();
2066-   auto  loc = implyingConf->getLoc ( );
2066+   auto  loc = extractNearestSourceLoc ( implyingConf->getDeclContext () );
20672067  Diags.diagnose (loc, diag::conditional_conformances_cannot_imply_conformances,
20682068                 conformance->getType (), implyingProto, protoType);
20692069
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import APINotesFrameworkTest
99
1010// CHECK-DIAGS-5-NOT: versioned-objc.swift:[[@LINE-1]]:
1111class  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
1313  func  requirement( )  ->  Any ?   {  return  nil  } 
1414} 
1515
Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ protocol StrictlyLocal {
106106} 
107107
108108distributed  actor  Nope1_StrictlyLocal :  StrictlyLocal  { 
109+   // expected-note@-1{{add '@preconcurrency' to the 'StrictlyLocal' conformance to suppress isolation-related diagnostics}}
110+ 
109111  func  local( )  { } 
110112  // expected-error@-1{{distributed actor-isolated instance method 'local()' cannot be used to satisfy nonisolated protocol requirement}}
111113  // 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 {
157159} 
158160
159161distributed  actor  Nope1_AsyncThrowsAll :  AsyncThrowsAll  { 
162+   // expected-note@-1{{add '@preconcurrency' to the 'AsyncThrowsAll' conformance to suppress isolation-related diagnostics}}
163+ 
160164  func  maybe( param:  String ,  int:  Int )  async  throws  ->  Int  {  111  } 
161165  // expected-error@-1{{distributed actor-isolated instance method 'maybe(param:int:)' cannot be used to satisfy nonisolated protocol requirement}}
162166  // 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 {
202206} 
203207
204208distributed  actor  DA_TerminationWatchingA :  TerminationWatchingA  { 
209+   // expected-note@-1{{add '@preconcurrency' to the 'TerminationWatchingA' conformance to suppress isolation-related diagnostics}}
210+ 
205211  func  terminated( a:  String )  {  } 
206212  // expected-error@-1{{distributed actor-isolated instance method 'terminated(a:)' cannot be used to satisfy nonisolated protocol requirement}}
207213  // 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