mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This patch updates all the tests to accept the new error messages. *Gack* so many things needed cleaning up.
32 lines
1.1 KiB
Swift
32 lines
1.1 KiB
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-experimental-concurrency -typecheck -verify -import-objc-header %S/Inputs/Delegate.h %s
|
|
// REQUIRES: concurrency
|
|
// REQUIRES: objc_interop
|
|
|
|
|
|
// overload resolution should pick sync version in a sync context
|
|
func syncContext() {
|
|
let r = Request()
|
|
let d = Delegate()
|
|
d.makeRequest1(r) // NOTE: this use to trigger an overload resolution error, see SR-13760
|
|
d.makeRequest2(r)
|
|
d.makeRequest3(r)
|
|
}
|
|
|
|
// overload resolution should pick async version in an async context
|
|
func asyncNoAwait() async {
|
|
let r = Request()
|
|
let d = Delegate()
|
|
d.makeRequest1(r) // expected-error@:3 {{expression is 'async' but is not marked with 'await'}} expected-note {{call is 'async'}}
|
|
d.makeRequest2(r) // expected-error@:3 {{expression is 'async' but is not marked with 'await'}} expected-note {{call is 'async'}}
|
|
d.makeRequest3(r) // expected-error@:3 {{expression is 'async' but is not marked with 'await'}} expected-note {{call is 'async'}}
|
|
}
|
|
|
|
|
|
func asyncWithAwait() async {
|
|
let r = Request()
|
|
let d = Delegate()
|
|
await d.makeRequest1(r)
|
|
await d.makeRequest2(r)
|
|
await d.makeRequest3(r)
|
|
}
|