Files
swift-mirror/validation-test/Evolution/Inputs/struct_add_initializer.swift
Slava Pestov 38baacae48 Evolution: Add test for adding a property initializer to a struct with an inlinable initializer
This used to fail because the property initializer had a public
symbol and was not serialized, so the struct's inlinable initializer
would reference it directly. Therefore, removing the property
initializer would break the client, which had inlined the
struct initializer.
2018-01-12 17:08:01 -08:00

35 lines
463 B
Swift

public func getVersion() -> Int {
#if BEFORE
return 0
#else
return 1
#endif
}
#if BEFORE
@_fixed_layout
public struct AddInitializer {
public var x: Int
// This could be @_inlineable, but we want to force inlining to take place
// at -Onone to get better test coverage.
@_transparent
public init() {
self.x = 0
}
}
#else
@_fixed_layout
public struct AddInitializer {
public var x: Int = 0
@_transparent
public init() {}
}
#endif