mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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.
35 lines
463 B
Swift
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
|