mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix more tests
This commit is contained in:
@@ -1013,14 +1013,14 @@ func testOptionalTryNeverFailsAddressOnlyVar<T>(_ obj: T) {
|
||||
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}}
|
||||
}
|
||||
|
||||
class SomeErrorClass : Error { }
|
||||
class SomeErrorClass : Error { } // expected-warning{{non-final class 'SomeErrorClass' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
|
||||
|
||||
// CHECK-LABEL: sil_vtable SomeErrorClass
|
||||
// CHECK-NEXT: #SomeErrorClass.init!allocator: {{.*}} : @$s6errors14SomeErrorClassCACycfC
|
||||
// CHECK-NEXT: #SomeErrorClass.deinit!deallocator: @$s6errors14SomeErrorClassCfD
|
||||
// CHECK-NEXT: }
|
||||
|
||||
class OtherErrorSub : OtherError { }
|
||||
class OtherErrorSub : OtherError { } // expected-warning{{non-final class 'OtherErrorSub' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
|
||||
|
||||
// CHECK-LABEL: sil_vtable OtherErrorSub {
|
||||
// CHECK-NEXT: #OtherError.init!allocator: {{.*}} : @$s6errors13OtherErrorSubCACycfC [override]
|
||||
|
||||
@@ -145,7 +145,7 @@ B(foo: 0) // expected-warning{{unused}}
|
||||
|
||||
// rdar://problem/33040113 - Provide fix-it for missing "try" when calling throwing Swift function
|
||||
|
||||
class E_33040113 : Error {}
|
||||
class E_33040113 : Error {} // expected-warning{{non-final class 'E_33040113' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
|
||||
func rdar33040113() throws -> Int {
|
||||
throw E_33040113()
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ actor A7 {
|
||||
}
|
||||
|
||||
// A non-actor can conform to the Actor protocol, if it does it properly.
|
||||
class C1: Actor {
|
||||
class C1: Actor { // expected-error{{non-final class 'C1' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
|
||||
func enqueue(partialTask: PartialAsyncTask) { }
|
||||
}
|
||||
|
||||
@@ -55,8 +55,9 @@ extension BA2 {
|
||||
@actorIndependent func enqueue(partialTask: PartialAsyncTask) { }
|
||||
}
|
||||
|
||||
// No synthesis for non-actores.
|
||||
// No synthesis for non-actors.
|
||||
class C2: Actor { // expected-error{{type 'C2' does not conform to protocol 'Actor'}}
|
||||
// expected-error@-1{{non-final class 'C2' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
|
||||
}
|
||||
|
||||
// Make sure the conformances actually happen.
|
||||
|
||||
@@ -34,13 +34,13 @@ enum EmptyErrorDomain: Error {}
|
||||
struct ErrorStruct : Error {
|
||||
}
|
||||
|
||||
class ErrorClass : Error {
|
||||
class ErrorClass : Error { // expected-warning{{non-final class 'ErrorClass' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
|
||||
}
|
||||
|
||||
struct ErrorStruct2 { }
|
||||
|
||||
extension ErrorStruct2 : Error { }
|
||||
|
||||
class ErrorClass2 { }
|
||||
class ErrorClass2 { } // expected-warning{{non-final class 'ErrorClass2' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
|
||||
|
||||
extension ErrorClass2 : Error { }
|
||||
|
||||
@@ -45,6 +45,7 @@ struct StructKey : CodingKey { // expected-error {{type 'StructKey' does not con
|
||||
|
||||
// Classes conforming to CodingKey should not get implict derived conformance.
|
||||
class ClassKey : CodingKey { //expected-error {{type 'ClassKey' does not conform to protocol 'CodingKey'}}
|
||||
// expected-warning@-1{{non-final class 'ClassKey' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
|
||||
}
|
||||
|
||||
// Types which are valid for CodingKey derived conformance should not get that
|
||||
|
||||
@@ -212,7 +212,7 @@ func sr_6400_3(error: Error) {
|
||||
}
|
||||
|
||||
class SR_6400_A {}
|
||||
class SR_6400_B: SR_6400_FakeApplicationDelegate & Error {}
|
||||
class SR_6400_B: SR_6400_FakeApplicationDelegate & Error {} // expected-warning{{non-final class 'SR_6400_B' cannot conform to `ConcurrentValue`; use `UnsafeConcurrentValue`}}
|
||||
|
||||
func sr_6400_4() {
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user