mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Types annotated as `@_addressableForDependencies` are still usable by older compilers that don't know about nonescapable types or lifetime dependencies, since it only affects the behavior of the type when it's the source of a dependency.
14 lines
536 B
Swift
14 lines
536 B
Swift
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name attrs -enable-experimental-feature AddressableTypes
|
|
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name attrs
|
|
// RUN: %FileCheck %s --input-file %t.swiftinterface
|
|
|
|
// REQUIRES: swift_feature_AddressableTypes
|
|
|
|
@_addressableForDependencies
|
|
public struct Foo {}
|
|
// CHECK: #if {{.*}} $AddressableTypes
|
|
// CHECK: @_addressableForDependencies public struct Foo
|
|
// CHECK: #else
|
|
// CHECK: {{^}}public struct Foo {
|
|
// CHECK: #endif
|