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
46 lines
667 B
Swift
46 lines
667 B
Swift
public func getVersion() -> Int {
|
|
#if BEFORE
|
|
return 0
|
|
#else
|
|
return 1
|
|
#endif
|
|
}
|
|
|
|
#if AFTER
|
|
@_weakLinked public struct ResilientStruct {
|
|
public init() {}
|
|
|
|
public func fn(_ x: Int) {}
|
|
|
|
public var storedProp: Int = 0
|
|
|
|
public var computedProp: Int {
|
|
get { return 0 }
|
|
set { }
|
|
}
|
|
|
|
public subscript(idx: Int) -> Int {
|
|
get { return 0 }
|
|
set { }
|
|
}
|
|
}
|
|
|
|
@_weakLinked @frozen public struct FixedLayoutStruct {
|
|
public init() {}
|
|
|
|
public func fn(_ x: Int) {}
|
|
|
|
public var storedProp: Int = 0
|
|
|
|
public var computedProp: Int {
|
|
get { return 0 }
|
|
set { }
|
|
}
|
|
|
|
public subscript(idx: Int) -> Int {
|
|
get { return 0 }
|
|
set { }
|
|
}
|
|
}
|
|
#endif
|