mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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.
53 lines
1.3 KiB
Swift
53 lines
1.3 KiB
Swift
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx50
|
|
|
|
// REQUIRES: OS=macosx
|
|
|
|
@available(*, unavailable)
|
|
class Unavailable {
|
|
deinit {}
|
|
}
|
|
|
|
@available(*, unavailable)
|
|
class UnavailableWithUnavailableDeinit {
|
|
@available(*, unavailable)
|
|
deinit {}
|
|
}
|
|
|
|
@available(*, unavailable)
|
|
enum UnavailableEnum {
|
|
class NestedWithUnavailableDeinit {
|
|
@available(*, unavailable)
|
|
deinit {}
|
|
}
|
|
}
|
|
|
|
class DeinitUnavailable {
|
|
@available(*, unavailable) // expected-error {{deinitializer cannot be marked unavailable with '@available'}}
|
|
deinit {}
|
|
}
|
|
|
|
class DeinitUnavailableMacOS {
|
|
@available(macOS, unavailable) // expected-error {{deinitializer cannot be marked unavailable with '@available'}}
|
|
deinit {}
|
|
}
|
|
|
|
class AvailableAtDeploymentTargetDeinit {
|
|
@available(macOS 50, *)
|
|
deinit {}
|
|
}
|
|
|
|
class PotentiallyUnavailableDeinit {
|
|
@available(macOS 51, *) // expected-error {{deinitializer cannot be marked potentially unavailable with '@available'}}
|
|
deinit {}
|
|
}
|
|
|
|
@available(macOS 51, *)
|
|
func funcAvailable51() {}
|
|
|
|
class AlwaysAvailable { // expected-note {{add @available attribute to enclosing class}}
|
|
deinit {
|
|
funcAvailable51() // expected-error {{'funcAvailable51()' is only available in macOS 51 or newer}}
|
|
// expected-note@-1 {{add 'if #available' version check}}
|
|
}
|
|
}
|