mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
32 lines
790 B
Swift
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
|
|
}
|