mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
...since they're part of the run-time representation. Not having this meant that someone compiling against an interface would miscompile uses of @objc enums defined in that interface! rdar://problem/50410541
26 lines
915 B
Swift
26 lines
915 B
Swift
// RUN: %target-swift-frontend -typecheck -emit-parseable-module-interface-path - %s -disable-objc-attr-requires-foundation-module -enable-objc-interop | %FileCheck %s
|
|
|
|
// CHECK-LABEL: public enum HasRawValue : Int {
|
|
public enum HasRawValue: Int {
|
|
// CHECK-NEXT: case a, b, c
|
|
case a, b = 5, c
|
|
// CHECK-DAG: public typealias RawValue = Swift.Int
|
|
// CHECK-DAG: @inlinable public init?(rawValue: Swift.Int)
|
|
// CHECK-DAG: public var rawValue: Swift.Int {
|
|
// CHECK-DAG: @inlinable get{{$}}
|
|
// CHECK-DAG: }
|
|
} // CHECK: {{^}$}}
|
|
|
|
@objc public enum ObjCEnum: Int32 {
|
|
case a, b = 5, c
|
|
}
|
|
|
|
// CHECK-LABEL: @objc public enum ObjCEnum : Int32 {
|
|
// CHECK-NEXT: case a, b = 5, c
|
|
// CHECK-DAG: public typealias RawValue = Swift.Int32
|
|
// CHECK-DAG: @inlinable public init?(rawValue: Swift.Int32)
|
|
// CHECK-DAG: public var rawValue: Swift.Int32 {
|
|
// CHECK-DAG: @inlinable get{{$}}
|
|
// CHECK-DAG: }
|
|
// CHECK: {{^}$}}
|