mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Enable checking for uses of potentially unavailable APIs. There is a frontend option to disable it: -disable-availability-checking. This commit updates the SDK overlays with @availability() annotations for the declarations where the overlay refers to potentially unavailable APIs. It also changes several tests that refer to potentially unavailable APIs to use either #available() or @availability annotations. Swift SVN r27272
31 lines
712 B
Swift
31 lines
712 B
Swift
// RUN: %target-build-swift -parse %s -Xfrontend -verify
|
|
// RUN: %target-build-swift -emit-ir -g %s -DNO_ERROR > /dev/null
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import OpenAL.AL
|
|
|
|
let _ = alGetError
|
|
let _ = OpenAL.alGetError
|
|
|
|
#if !NO_ERROR
|
|
let _ = alcCreateContext // expected-error{{use of unresolved identifier 'alcCreateContext'}}
|
|
#endif
|
|
|
|
#if os(OSX)
|
|
import OpenGL.GL3
|
|
let _ = glGetString
|
|
let _ = OpenGL.glGetString
|
|
|
|
import AppKit.NSPanGestureRecognizer
|
|
|
|
@availability(OSX, introduced=10.10)
|
|
typealias PanRecognizer = NSPanGestureRecognizer
|
|
typealias PanRecognizer2 = AppKit.NSPanGestureRecognizer
|
|
|
|
#endif
|
|
|
|
#if !NO_ERROR
|
|
let _ = glVertexPointer // expected-error{{use of unresolved identifier 'glVertexPointer'}}
|
|
#endif
|