mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Because we don't form a type-checked call to the Regex initializer in the AST, we need to explicitly handle the availability checking for `Regex<Output>` and the initializer we're implicitly calling. rdar://92156542
16 lines
455 B
Swift
16 lines
455 B
Swift
// RUN: %target-typecheck-verify-swift -enable-bare-slash-regex -target %target-cpu-apple-macosx12.0
|
|
|
|
// REQUIRES: swift_in_compiler
|
|
// REQUIRES: OS=macosx
|
|
|
|
_ = /x/ // expected-error {{'Regex' is only available in}}
|
|
// expected-note@-1 {{add 'if #available' version check}}
|
|
|
|
_ = #/x/# // expected-error {{'Regex' is only available in}}
|
|
// expected-note@-1 {{add 'if #available' version check}}
|
|
|
|
if #available(SwiftStdlib 5.7, *) {
|
|
_ = /x/
|
|
_ = #/x/#
|
|
}
|