File tree Expand file tree Collapse file tree 6 files changed +11
-9
lines changed Expand file tree Collapse file tree 6 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -1013,14 +1013,14 @@ func testOptionalTryNeverFailsAddressOnlyVar<T>(_ obj: T) {
1013
1013
var copy = try ? obj // expected-warning {{no calls to throwing functions occur within 'try' expression}} expected-warning {{initialization of variable 'copy' was never used; consider replacing with assignment to '_' or removing it}}
1014
1014
}
1015
1015
1016
- class SomeErrorClass : Error { }
1016
+ class SomeErrorClass : Error { } // expected-warning{{non-final class 'SomeErrorClass' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
1017
1017
1018
1018
// CHECK-LABEL: sil_vtable SomeErrorClass
1019
1019
// CHECK-NEXT: #SomeErrorClass.init!allocator: {{.*}} : @$s6errors14SomeErrorClassCACycfC
1020
1020
// CHECK-NEXT: #SomeErrorClass.deinit!deallocator: @$s6errors14SomeErrorClassCfD
1021
1021
// CHECK-NEXT: }
1022
1022
1023
- class OtherErrorSub : OtherError { }
1023
+ class OtherErrorSub : OtherError { } // expected-warning{{non-final class 'OtherErrorSub' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
1024
1024
1025
1025
// CHECK-LABEL: sil_vtable OtherErrorSub {
1026
1026
// CHECK-NEXT: #OtherError.init!allocator: {{.*}} : @$s6errors13OtherErrorSubCACycfC [override]
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ B(foo: 0) // expected-warning{{unused}}
145
145
146
146
// rdar://problem/33040113 - Provide fix-it for missing "try" when calling throwing Swift function
147
147
148
- class E_33040113 : Error { }
148
+ class E_33040113 : Error { } // expected-warning{{non-final class 'E_33040113' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
149
149
func rdar33040113( ) throws -> Int {
150
150
throw E_33040113 ( )
151
151
}
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ actor A7 {
33
33
}
34
34
35
35
// A non-actor can conform to the Actor protocol, if it does it properly.
36
- class C1 : Actor {
36
+ class C1 : Actor { // expected-error{{non-final class 'C1' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
37
37
func enqueue( partialTask: PartialAsyncTask ) { }
38
38
}
39
39
@@ -55,8 +55,9 @@ extension BA2 {
55
55
@actorIndependent func enqueue( partialTask: PartialAsyncTask ) { }
56
56
}
57
57
58
- // No synthesis for non-actores .
58
+ // No synthesis for non-actors .
59
59
class C2 : Actor { // expected-error{{type 'C2' does not conform to protocol 'Actor'}}
60
+ // expected-error@-1{{non-final class 'C2' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
60
61
}
61
62
62
63
// Make sure the conformances actually happen.
Original file line number Diff line number Diff line change @@ -34,13 +34,13 @@ enum EmptyErrorDomain: Error {}
34
34
struct ErrorStruct : Error {
35
35
}
36
36
37
- class ErrorClass : Error {
37
+ class ErrorClass : Error { // expected-warning{{non-final class 'ErrorClass' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
38
38
}
39
39
40
40
struct ErrorStruct2 { }
41
41
42
42
extension ErrorStruct2 : Error { }
43
43
44
- class ErrorClass2 { }
44
+ class ErrorClass2 { } // expected-warning{{non-final class 'ErrorClass2' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
45
45
46
46
extension ErrorClass2 : Error { }
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ struct StructKey : CodingKey { // expected-error {{type 'StructKey' does not con
45
45
46
46
// Classes conforming to CodingKey should not get implict derived conformance.
47
47
class ClassKey : CodingKey { //expected-error {{type 'ClassKey' does not conform to protocol 'CodingKey'}}
48
+ // expected-warning@-1{{non-final class 'ClassKey' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
48
49
}
49
50
50
51
// Types which are valid for CodingKey derived conformance should not get that
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ func sr_6400_3(error: Error) {
212
212
}
213
213
214
214
class SR_6400_A { }
215
- class SR_6400_B : SR_6400_FakeApplicationDelegate & Error { }
215
+ class SR_6400_B : SR_6400_FakeApplicationDelegate & Error { } // expected-warning{{non-final class 'SR_6400_B' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
216
216
217
217
func sr_6400_4( ) {
218
218
do {
@@ -270,4 +270,4 @@ func takesClosure(_: (() -> ())) throws -> Int {}
270
270
271
271
func passesClosure( ) {
272
272
_ = try takesClosure { } // expected-error {{errors thrown from here are not handled}}
273
- }
273
+ }
You can’t perform that action at this time.
0 commit comments