mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Un-reverts 9c01ee2c1b.
Also, add myself as a reviewer for more availability related files.
NFC.
15 lines
549 B
Swift
15 lines
549 B
Swift
// Ensure that the `unnecessary check` availability warning is emitted when unnecessary due to
|
|
// scope's explicit annotation
|
|
|
|
// RUN: %target-typecheck-verify-swift -verify -target %target-cpu-apple-macosx11.2 -disable-objc-attr-requires-foundation-module
|
|
// REQUIRES: OS=macosx
|
|
|
|
@available(macOS 11.1, *)
|
|
class Foo {
|
|
// expected-note@-1 {{enclosing scope here}}
|
|
func foo() {
|
|
// expected-warning@+1 {{unnecessary check for 'macOS'; enclosing scope ensures guard will always be true}}
|
|
if #available(macOS 11.0, *) {}
|
|
}
|
|
}
|