Files
swift-mirror/validation-test/Evolution/Inputs/generic_resilient_struct_add_property.swift
Pavel Yaskevich 6a45971c3c [IRGen/Resilience] Add a test case for rdar://problem/36560486
Since field offsets are now encoded after generic parameters, it
is useful to validate that using generic parameter metadata is now
more resilient in presence of new fields.
2018-01-29 23:25:29 -08:00

40 lines
429 B
Swift

public func getVersion() -> Int {
#if BEFORE
return 0
#else
return 1
#endif
}
public protocol P {
static func compute() -> Int
}
public struct A : P {
public init() {}
public static func compute() -> Int {
return 42
}
}
#if BEFORE
public struct S<T: P> {
public init() {}
}
#else
public struct S<T: P> {
public init() {
question = "Ultimate Question"
}
public var question: String
}
#endif