mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Destructors are always called if declared, so allowing deinit to be declared as
unavailable (or potentially unavailable) creates a type checking loophole that
allows unavailable code to execute at runtime:
```
class C {
@available(*, unavailable)
deinit {
print("Oops")
}
}
_ = C() // prints "Oops"
```
Resolves rdar://106409012 and https://github.com/apple/swift/issues/63854.
1.3 KiB
1.3 KiB