mirror of
https://github.com/apple/swift.git
synced 2026-10-10 13:50:43 +02:00
The accepted spelling of the official attribute is `@c`. In the fullness of time, it would be confusing that tests for `@c` refer to the old spelling (`@_cdecl`).
16 lines
621 B
Swift
16 lines
621 B
Swift
// RUN: %target-typecheck-verify-swift -enable-objc-interop \
|
|
// RUN: -disable-availability-checking
|
|
|
|
// REQUIRES: concurrency
|
|
|
|
@_cdecl("async") // expected-error{{@_cdecl global function cannot be asynchronous}}
|
|
func asynchronous() async { }
|
|
|
|
@c(async2) // expected-error{{@c global function cannot be asynchronous}}
|
|
func asynchronous2() async { }
|
|
|
|
@c(asyncParam)
|
|
func asynchronousParam(fn: (String) async -> Int) { }
|
|
// expected-error @-1 {{global function cannot be marked '@c' because the type of the parameter cannot be represented in C}}
|
|
// expected-note @-2 {{'async' function types cannot be represented in C}}
|