mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
* De-underscore @frozen for enums * Add @frozen for structs, deprecate @_fixed_layout for them * Switch usage from _fixed_layout to frozen
36 lines
455 B
Swift
36 lines
455 B
Swift
precedencegroup AssignmentPrecedence { assignment: true }
|
|
|
|
public enum Optional<T> {
|
|
case none
|
|
case some(T)
|
|
}
|
|
|
|
@frozen
|
|
public struct B {
|
|
@inlinable
|
|
public func amIConfused() {}
|
|
@inlinable
|
|
public init() {}
|
|
}
|
|
|
|
@frozen
|
|
public struct A {
|
|
public var b : B
|
|
|
|
@inlinable
|
|
public init() {
|
|
b = B()
|
|
}
|
|
|
|
@inlinable
|
|
public func isBConfused() {
|
|
b.amIConfused()
|
|
}
|
|
}
|
|
|
|
@inlinable
|
|
public func doSomething() -> A {
|
|
var a = A()
|
|
return a
|
|
}
|