mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Repurpose mangling operator `Y` as an umbrella operator that covers new attributes on function types. Free up operators `J`, `j`, and `k`. ``` async ::= 'Ya' // 'async' annotation on function types sendable ::= 'Yb' // @Sendable on function types throws ::= 'K' // 'throws' annotation on function types differentiable ::= 'Yjf' // @differentiable(_forward) on function type differentiable ::= 'Yjr' // @differentiable(reverse) on function type differentiable ::= 'Yjd' // @differentiable on function type differentiable ::= 'Yjl' // @differentiable(_linear) on function type ``` Resolves rdar://76299796.
26 lines
766 B
Swift
26 lines
766 B
Swift
import _Concurrency
|
|
|
|
func printGeneric<T>(_ t: T) {
|
|
print(t)
|
|
}
|
|
// CHECK-LL: @"$s4main6call_fyyAA1CCYaFTu" = {{(dllexport )?}}{{(protected )?}}global %swift.async_func_pointer
|
|
// CHECK-LL: @"$s4main1CC1fyyYaFTu" = {{(dllexport )?}}{{(protected )?}}global %swift.async_func_pointer
|
|
|
|
// CHECK-LL: define {{(dllexport )?}}{{(protected )?}}swift{{(tail)?}}cc void @"$s4main6call_fyyAA1CCYaF"(
|
|
// CHECK-LL: define {{(dllexport )?}}{{(protected )?}}swift{{(tail)?}}cc void @"$s4main1CC1fyyYaF"(
|
|
public func call_f(_ c: C) async {
|
|
print("entering call_f")
|
|
await c.f()
|
|
print("exiting call_f")
|
|
}
|
|
open class C {
|
|
public init() {}
|
|
func f() async {
|
|
printGeneric("entering f")
|
|
printGeneric(Self.self)
|
|
printGeneric(self)
|
|
printGeneric("exiting f")
|
|
}
|
|
}
|
|
|