mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Just like `@preconcurrency` for concurrency, this attribute is going to allow exhaustiveness error downgrades for enums that were retroactively marked as `@extensible`.
30 lines
1005 B
Swift
30 lines
1005 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -enable-experimental-feature ExtensibleAttribute -module-name Library
|
|
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -enable-experimental-feature ExtensibleAttribute -module-name Library
|
|
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -module-name Library
|
|
// RUN: %FileCheck %s < %t/Library.swiftinterface
|
|
|
|
// REQUIRES: swift_feature_ExtensibleAttribute
|
|
|
|
// CHECK: #if compiler(>=5.3) && $ExtensibleAttribute
|
|
// CHECK-NEXT: @extensible public enum E {
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: #else
|
|
// CHECK-NEXT: public enum E {
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: #endif
|
|
@extensible
|
|
public enum E {
|
|
}
|
|
|
|
// CHECK: #if compiler(>=5.3) && $ExtensibleAttribute
|
|
// CHECK-NEXT: @preEnumExtensibility @extensible public enum F {
|
|
// CHECK: #else
|
|
// CHECK-NEXT: public enum F {
|
|
// CHECK: #endif
|
|
@preEnumExtensibility
|
|
@extensible
|
|
public enum F {
|
|
case a
|
|
}
|