mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
* De-underscore @frozen for enums * Add @frozen for structs, deprecate @_fixed_layout for them * Switch usage from _fixed_layout to frozen
35 lines
447 B
Swift
35 lines
447 B
Swift
|
|
public func getVersion() -> Int {
|
|
#if BEFORE
|
|
return 0
|
|
#else
|
|
return 1
|
|
#endif
|
|
}
|
|
|
|
#if BEFORE
|
|
|
|
@frozen
|
|
public struct AddInitializer {
|
|
public var x: Int
|
|
|
|
// This could be @inlinable, but we want to force inlining to take place
|
|
// at -Onone to get better test coverage.
|
|
@_transparent
|
|
public init() {
|
|
self.x = 0
|
|
}
|
|
}
|
|
|
|
#else
|
|
|
|
@frozen
|
|
public struct AddInitializer {
|
|
public var x: Int = 0
|
|
|
|
@_transparent
|
|
public init() {}
|
|
}
|
|
|
|
#endif
|