@@ -22,6 +22,12 @@ protocol SyncProtocol {
2222
2323 func syncMethodC( ) -> Int
2424
25+ func syncMethodE( ) -> Void // expected-note{{mark the protocol requirement 'syncMethodE()' 'async' to allow actor-isolated conformances}}{{21-21= async}}
26+
27+ func syncMethodF( param: String ) -> Int // expected-note{{mark the protocol requirement 'syncMethodF(param:)' 'async' to allow actor-isolated conformances}}{{34-34= async}}
28+
29+ func syncMethodG( ) throws -> Void // expected-note{{mark the protocol requirement 'syncMethodG()' 'async' to allow actor-isolated conformances}}{{22-22=async }}
30+
2531 subscript ( index: Int ) -> String { get } // expected-note{{'subscript(_:)' declared here}}
2632
2733 static func staticMethod( )
@@ -44,6 +50,18 @@ actor OtherActor: SyncProtocol {
4450 // FIXME: Consider suggesting nonisolated if this didn't match.
4551 nonisolated func syncMethodC( ) -> Int { 5 }
4652
53+ func syncMethodE( ) -> Void { }
54+ // expected-error@-1{{actor-isolated instance method 'syncMethodE()' cannot be used to satisfy nonisolated protocol requirement}}
55+ // expected-note@-2{{add 'nonisolated' to 'syncMethodE()' to make this instance method not isolated to the actor}}{{3-3=nonisolated }}
56+
57+ func syncMethodF( param: String ) -> Int { 5 }
58+ // expected-error@-1{{actor-isolated instance method 'syncMethodF(param:)' cannot be used to satisfy nonisolated protocol requirement}}
59+ // expected-note@-2{{add 'nonisolated' to 'syncMethodF(param:)' to make this instance method not isolated to the actor}}{{3-3=nonisolated }}
60+
61+ func syncMethodG( ) { }
62+ // expected-error@-1{{actor-isolated instance method 'syncMethodG()' cannot be used to satisfy nonisolated protocol requirement}}
63+ // expected-note@-2{{add 'nonisolated' to 'syncMethodG()' to make this instance method not isolated to the actor}}{{3-3=nonisolated }}
64+
4765 subscript ( index: Int ) -> String { " \( index) " }
4866 // expected-error@-1{{actor-isolated subscript 'subscript(_:)' cannot be used to satisfy nonisolated protocol requirement}}
4967 // expected-note@-2{{add 'nonisolated' to 'subscript(_:)' to make this subscript not isolated to the actor}}{{3-3=nonisolated }}
@@ -77,4 +95,4 @@ actor A2: Initializers {
7795 init ( int: Int ) { }
7896
7997 func withBells( ) async -> A2 { self }
80- }
98+ }
0 commit comments