Files
swift-mirror/test/ModuleInterface/isolated_any_suppression.swift
Allan Shortlidge 590d3353e6 Frontend: Introduce an alias for the IsolatedAny experimental feature.
To preserve compatibility with older compilers that do not allow `IsolatedAny`
to be enabled in production compilers, use an alias experimental feature when
building the stdlib (`IsolatedAny2`).

Also, add `@_allowFeatureSuppression(IsolatedAny)` in a couple spots it was
forgotten.

Partially resolves rdar://125138945
2024-03-27 22:20:50 -07:00

24 lines
1.2 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -module-name isolated_any -emit-module -o %t/isolated_any.swiftmodule -emit-module-interface-path - -enable-experimental-feature IsolatedAny %s | %FileCheck %s
// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -module-name isolated_any -emit-module -o %t/isolated_any.swiftmodule -emit-module-interface-path - -enable-experimental-feature IsolatedAny2 %s | %FileCheck %s
// CHECK: #if compiler(>=5.3) && $IsolatedAny
// CHECK-NEXT: {{^}}public func test1(fn: @isolated(any) @Sendable () -> ())
// CHECK-NEXT: #endif
public func test1(fn: @isolated(any) () -> ()) {}
// CHECK-NEXT: #if compiler(>=5.3) && $IsolatedAny
// CHECK-NEXT: {{^}}public func test2(fn: @isolated(any) @Sendable () -> ())
// CHECK-NEXT: #endif
@_allowFeatureSuppression(XXX)
public func test2(fn: @isolated(any) () -> ()) {}
// CHECK-NEXT: #if compiler(>=5.3) && $IsolatedAny
// CHECK-NEXT: {{^}}public func test3(fn: @isolated(any) @Sendable () -> ())
// CHECK-NEXT: #else
// CHECK-NEXT: {{^}}public func test3(fn: @Sendable () -> ())
// CHECK-NEXT: #endif
@_allowFeatureSuppression(IsolatedAny)
public func test3(fn: @isolated(any) () -> ()) {}