mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
For the moment, we do not consider APIs deprecated earlier than watchOS 2.0 as unavailable. rdar://problem/20948019 track changing this once the ultimate decision on this policy has been made. This addresses the compile-time components of rdar://problem/20774229 Swift SVN r28559
20 lines
737 B
Swift
20 lines
737 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify -I %S/Inputs/custom-modules %s
|
|
|
|
// REQUIRES: OS=watchos
|
|
|
|
import Foundation
|
|
import AvailabilityExtras
|
|
|
|
func test_unavailable_because_deprecated() {
|
|
// This is transcribed by clang to be deprecated on watchOS 2.0
|
|
// We don't currently treat these unavailable, but the policy decision
|
|
// hasn't been made yet.
|
|
// rdar://problem/20948019 tracks changing this, if needed, when the
|
|
// policy decision is made.
|
|
print(NSRealMemoryAvailable()) // expected-warning {{'NSRealMemoryAvailable()' was deprecated in watchOS 2.0}}
|
|
}
|
|
|
|
func test_swift_unavailable_wins() {
|
|
unavailableWithOS() // expected-error {{'unavailableWithOS()' is unavailable in Swift}}
|
|
}
|