Files
swift-mirror/test/ModuleInterface/nonexhaustive_attr.swift
Pavel Yaskevich a7ecd309d4 [AST] SE-0487: Promote NonexhaustiveAttribute to a language feature
The proposal [has been accepted](https://forums.swift.org/t/accepted-se-0487-nonexhaustive-enums/81508)
which makes the feature experimental no longer.
2025-08-20 00:39:51 -07:00

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
}