Files
swift-mirror/test/ParseableInterface/synthesized.swift
Jordan Rose 9ba1d8a1c6 [ModuleInterface] Include the raw values of @objc enums (#24487)
...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
2019-05-04 10:14:46 -07:00

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: {{^}$}}