Files
swift-mirror/test/Sema/api-availability-only.swift
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

14 lines
396 B
Swift

/// Verify that -check-api-availability-only has no effect since it is deprecated.
// RUN: %target-typecheck-verify-swift -check-api-availability-only -verify
// REQUIRES: OS=macosx
@available(macOS 52, *)
public struct S {}
@available(macOS 51, *)
public func newFunc() {
_ = S() // expected-error {{'S' is only available in}}
// expected-note @-1 {{add 'if #available' version check}}
}