Files
swift-mirror/test/IRGen/async/Inputs/class_open-1instance-void_to_void.swift
Richard Wei fb66de6126 Unify mangling operators for async, @Sendable, @differentiable and @noDerivative.
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.
2021-04-07 17:49:10 -07:00

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")
}
}