Files
swift-mirror/test/ClangModules/availability_macosx.swift
Jordan Rose 182ef27f95 [ClangImporter] Handle __attribute__((availability(swift, unavailable))).
This is the new and improved version of
__attribute__((annotate("swift1_unavailable"))), with the "improved" being
specifically that the 'availability' attribute supports a message.

This requires a corresponding Clang commit.

Swift side of rdar://problem/18768673.

Swift SVN r27053
2015-04-07 02:40:22 +00:00

15 lines
481 B
Swift

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify -I %S/Inputs/custom-modules %s
// REQUIRES: OS=macosx
import Foundation
import AvailabilityExtras
func test_unavailable_because_deprecated() {
println(NSRealMemoryAvailable()) // expected-error {{APIs deprecated as of OS X 10.9 and earlier are unavailable in Swift}}
}
func test_swift_unavailable_wins() {
unavailableWithOS() // expected-error {{'unavailableWithOS()' is unavailable in Swift}}
}