Files
swift-mirror/test/Sema/availability_enum_case.swift
Allan Shortlidge be70c568cb Frontend: Deprecate -warn-on-potentially-unavailable-enum-case option.
When `-warn-on-potentially-unavailable-enum-case` was introduced, the build
system was required to invoke `swift-frontend` at artificially low deployment
targets when emitting `.swiftinterface` files for legacy architectures. Because
the deployment target was low, some availability diagnostics needed to be
de-fanged in order to allow module interface emission to succeed. Today, the
build system is able to use the correct deployment target when emitting module
interfaces and the `-warn-on-potentially-unavailable-enum-case` is superfluous,
so deprecate it.

Resolves rdar://114092047
2023-08-18 10:02:39 -07:00

20 lines
958 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift -emit-module %S/Inputs/availability_enum_case_other.swift -target %target-cpu-apple-macosx10.50 -emit-module-interface-path %t/availability_enum_case_other.swiftinterface -swift-version 5 -enable-library-evolution
// RUN: %target-typecheck-verify-swift -I %t
// RUN: %target-build-swift -emit-module %S/Inputs/availability_enum_case_other.swift -target %target-cpu-apple-macosx10.50 -emit-module-interface-path %t/availability_enum_case_other.swiftinterface -swift-version 5 -enable-library-evolution -whole-module-optimization
// RUN: %target-typecheck-verify-swift -I %t
// REQUIRES: OS=macosx
import availability_enum_case_other
func ride(horse: Horse) {
// expected-note@-1 {{add @available attribute to enclosing global function}}
_ = Horse.kevin
// expected-error@-1 {{'kevin' is only available in macOS 10.50 or newer}}
// expected-note@-2 {{add 'if #available' version check}}
}