Files
swift-mirror/test/Interpreter/availability_host_os.swift
Brent Royal-Gordon 3494c0bd88 [TypeChecker] Rephrase platforms in availability diagnostics
This does several different things to improve how platforms are described in availability diagnostics:

• Mentions the platform in diagnostics for platform-specific @available(unavailable) attributes.
• Replaces “OS X” with “macOS”.
• Replaces “fooOS application extension” with “application extensions for fooOS”.
• Replaces “on fooOS” with “in fooOS”.

Fixes <rdar://problem/49963341>.
2019-04-30 16:32:43 -07:00

19 lines
704 B
Swift

// Note: This is deliberately testing the target-less invocation of swift(c).
// RUN: %swiftc_driver -typecheck -import-objc-header %S/Inputs/availability_host_os.h -DFAIL -Xfrontend -verify %s
// RUN: %swift_driver -import-objc-header %S/Inputs/availability_host_os.h -DFAIL -Xfrontend -verify %s
// RUN: %swift_driver -import-objc-header %S/Inputs/availability_host_os.h %s | %FileCheck %s
// REQUIRES: OS=macosx
// REQUIRES: executable_test
print(mavericks()) // CHECK: {{^9$}}
print(yosemite()) // CHECK-NEXT: {{^10$}}
#if FAIL
print(todosSantos()) // expected-error {{'todosSantos()' is only available in macOS 10.99 or newer}}
// expected-note@-1 {{add 'if #available' version check}}
#endif