Files
swift-mirror/test/SILGen/enum_generic_raw_value.swift
Joe Groff 6235a348c8 Sema: Fix some regressions in RawRepresentable derivation for enums.
Fix a mismatch in the generated interface type and contextual type for the init(rawValue:) initializer; the former was lacking the '(rawValue:)' label and freaking out SILGen's abstraction lowering. When deriving the body of init(rawValue:), substitute the (interface) raw type into the initializer's context, so that we can successfully compare it to other contextualized types in the body's context. Fixes <rdar://problem/19986886>.

Swift SVN r25775
2015-03-05 02:16:35 +00:00

12 lines
446 B
Swift

// RUN: %target-swift-frontend -emit-silgen %s | FileCheck %s
// CHECK-LABEL: sil hidden @_TFO22enum_generic_raw_value1ECU__fMGS0_Q__FT8rawValueSi_GSqGS0_Q___
enum E<T>: Int {
case A = 1
}
// CHECK-LABEL: sil hidden @_TFO22enum_generic_raw_value1FCUSs9EquatableSs25IntegerLiteralConvertible_USs33_BuiltinIntegerLiteralConvertible__fMGS0_Q__FT8rawValueQ__GSqGS0_Q___
enum F<T: IntegerLiteralConvertible where T: Equatable>: T {
case A = 1
}