mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Checking for `-disable-availability-checking` in `ConstraintSystem::isDeclUnavailable` caused a regression with obsolete/introduced checking. Let's rely on `DeclAttributes::isUnavailable` and `TypeChecker::isDeclAvailable` to do the right thing instead. Resolves: rdar://problem/60898369
12 lines
250 B
Swift
12 lines
250 B
Swift
// RUN: %target-typecheck-verify-swift -disable-availability-checking -swift-version 5
|
|
|
|
struct S {
|
|
@available(swift, obsoleted: 4.2)
|
|
init(foo: Int) throws {}
|
|
|
|
@available(swift, introduced: 4.2)
|
|
init?(foo: Int) throws {}
|
|
}
|
|
|
|
_ = try S(foo: 42)
|