Commit Graph

2 Commits

Author SHA1 Message Date
Ben Langmuir
fd1875dcfb [test] Move availability tests to later fake OS versions
10.50 was once greater than any real macOS version, but now it compares
less than real released versions, which makes these tests depend on the
deployment target unnecessarily. Update these tests to use even larger
numbers to hopefully keep them independent a little longer.
2024-08-21 11:38:54 -07:00
Allan Shortlidge
0d23dc6346 Sema: Ban unavailable deinits.
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.
2023-04-01 14:30:35 -07:00