mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Values produced by address-only `enum` instructions have non-none ownership. And because `enum` is representation-changing, they have `owned` ownership. This corresponds at the opaque values SIL stage to the fact that at the address-lowered SIL stage the storage location has non-trivial initialization which must be `destroy_addr`d, regardless of whether an empty case was stored to it.
15 lines
315 B
Swift
15 lines
315 B
Swift
public class ClassEquatable : Equatable {
|
|
public static func ==(lhs: ClassEquatable, rhs: ClassEquatable) -> Bool { lhs === rhs }
|
|
}
|
|
|
|
public enum EnumNontrivialWithEmptyCases : Equatable {
|
|
case empty
|
|
case other
|
|
case loaded(ClassEquatable)
|
|
}
|
|
|
|
public enum EnumTrivial : Equatable {
|
|
case empty
|
|
case other
|
|
}
|