mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The proposal [has been accepted](https://forums.swift.org/t/accepted-se-0487-nonexhaustive-enums/81508) which makes the feature experimental no longer.
26 lines
743 B
Swift
26 lines
743 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -module-name Library
|
|
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -module-name Library
|
|
// RUN: %FileCheck %s < %t/Library.swiftinterface
|
|
|
|
// CHECK: #if compiler(>=5.3) && $NonexhaustiveAttribute
|
|
// CHECK-NEXT: @nonexhaustive public enum E {
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: #else
|
|
// CHECK-NEXT: public enum E {
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: #endif
|
|
@nonexhaustive
|
|
public enum E {
|
|
}
|
|
|
|
// CHECK: #if compiler(>=5.3) && $NonexhaustiveAttribute
|
|
// CHECK-NEXT: @nonexhaustive(warn) public enum F {
|
|
// CHECK: #else
|
|
// CHECK-NEXT: public enum F {
|
|
// CHECK: #endif
|
|
@nonexhaustive(warn)
|
|
public enum F {
|
|
case a
|
|
}
|