Files
swift-mirror/test/Serialization/Inputs/use_imported_enums.swift
Doug Gregor f4135f963d [Conformance lookup table] Prefer synthesized conformances to deserialized ones.
When a conformance can either be synthesized or implied, we tend to prefer
implied. However, if the implied conformance comes from a deserialized
conformance, it will lead to an incomplete conformance and cause a crash.

This is a narrow fix for SR-6105 / rdar://problem/34911378.
2017-10-16 15:35:11 -07:00

32 lines
790 B
Swift

import Foundation
@inline(__always) @_transparent public func compareToSelf<T: Equatable>(_ t: T) -> Bool {
return t == t
}
@inline(__always) @_transparent public func compareImportedEnumToSelf(_ e: NSRuncingMode) -> Bool {
return compareToSelf(e)
}
// SR-6105
open class EVC<EnumType : EVT> where EnumType.RawValue : Hashable {
}
public protocol EVT : RawRepresentable {
associatedtype Wrapper
associatedtype Constructor
}
open class EVO<EnumType> {
}
final public class CSWrapperConstructorClass : EVC<ByteCountFormatter.CountStyle> {
}
final public class CSWrapperClass : EVO<ByteCountFormatter.CountStyle> {
}
extension ByteCountFormatter.CountStyle : EVT {
public typealias Wrapper = CSWrapperClass
public typealias Constructor = CSWrapperConstructorClass
}