Skip to content

Commit 09121d7

Browse files
committed
Fix more tests
1 parent 2f213d5 commit 09121d7

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

test/SILGen/errors.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,14 +1013,14 @@ func testOptionalTryNeverFailsAddressOnlyVar<T>(_ obj: T) {
10131013
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}}
10141014
}
10151015

1016-
class SomeErrorClass : Error { }
1016+
class SomeErrorClass : Error { } // expected-warning{{non-final class 'SomeErrorClass' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
10171017

10181018
// CHECK-LABEL: sil_vtable SomeErrorClass
10191019
// CHECK-NEXT: #SomeErrorClass.init!allocator: {{.*}} : @$s6errors14SomeErrorClassCACycfC
10201020
// CHECK-NEXT: #SomeErrorClass.deinit!deallocator: @$s6errors14SomeErrorClassCfD
10211021
// CHECK-NEXT: }
10221022

1023-
class OtherErrorSub : OtherError { }
1023+
class OtherErrorSub : OtherError { } // expected-warning{{non-final class 'OtherErrorSub' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
10241024

10251025
// CHECK-LABEL: sil_vtable OtherErrorSub {
10261026
// CHECK-NEXT: #OtherError.init!allocator: {{.*}} : @$s6errors13OtherErrorSubCACycfC [override]

test/decl/func/throwing_functions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ B(foo: 0) // expected-warning{{unused}}
145145

146146
// rdar://problem/33040113 - Provide fix-it for missing "try" when calling throwing Swift function
147147

148-
class E_33040113 : Error {}
148+
class E_33040113 : Error {} // expected-warning{{non-final class 'E_33040113' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
149149
func rdar33040113() throws -> Int {
150150
throw E_33040113()
151151
}

test/decl/protocol/special/Actor.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ actor A7 {
3333
}
3434

3535
// 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`}}
3737
func enqueue(partialTask: PartialAsyncTask) { }
3838
}
3939

@@ -55,8 +55,9 @@ extension BA2 {
5555
@actorIndependent func enqueue(partialTask: PartialAsyncTask) { }
5656
}
5757

58-
// No synthesis for non-actores.
58+
// No synthesis for non-actors.
5959
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`}}
6061
}
6162

6263
// Make sure the conformances actually happen.

test/decl/protocol/special/Error.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ enum EmptyErrorDomain: Error {}
3434
struct ErrorStruct : Error {
3535
}
3636

37-
class ErrorClass : Error {
37+
class ErrorClass : Error { // expected-warning{{non-final class 'ErrorClass' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
3838
}
3939

4040
struct ErrorStruct2 { }
4141

4242
extension ErrorStruct2 : Error { }
4343

44-
class ErrorClass2 { }
44+
class ErrorClass2 { } // expected-warning{{non-final class 'ErrorClass2' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
4545

4646
extension ErrorClass2 : Error { }

test/decl/protocol/special/coding/enum_coding_key.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ struct StructKey : CodingKey { // expected-error {{type 'StructKey' does not con
4545

4646
// Classes conforming to CodingKey should not get implict derived conformance.
4747
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`}}
4849
}
4950

5051
// Types which are valid for CodingKey derived conformance should not get that

test/stmt/errors.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func sr_6400_3(error: Error) {
212212
}
213213

214214
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`}}
216216

217217
func sr_6400_4() {
218218
do {
@@ -270,4 +270,4 @@ func takesClosure(_: (() -> ())) throws -> Int {}
270270

271271
func passesClosure() {
272272
_ = try takesClosure { } // expected-error {{errors thrown from here are not handled}}
273-
}
273+
}

0 commit comments

Comments
 (0)