Check unavailable from async in interface file

We need to check the feature availability of _unavailableFromAsync
before it gets picked up in the swift interface file. This updates the
compiler to provide the necessary wrappings for that check.
This commit is contained in:
Evan Wilde
2022-03-04 14:51:44 -08:00
parent e4c51ba32a
commit 822097353b
3 changed files with 23 additions and 0 deletions

View File

@@ -177,4 +177,12 @@ public func unsafeInheritExecutor() async {}
@_specialize(exported: true, availability: SwiftStdlib 5.1, *; where T == Int)
public func multipleSuppressible<T>(value: T) async {}
// CHECK: #if compiler(>=5.3) && $UnavailableFromAsync
// CHECK-NEXT: @_unavailableFromAsync(message: "Test") public func unavailableFromAsyncFunc()
// CHECK-NEXT: #else
// CHECK-NEXT: public func unavailableFromAsyncFunc()
// CHECK-NEXT: #endif
@_unavailableFromAsync(message: "Test")
public func unavailableFromAsyncFunc() { }
// CHECK-NOT: extension FeatureTest.MyActor : Swift.Sendable