mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Introduce a frontend flag that disables experimental string processing, including `/.../` literals.
15 lines
709 B
Swift
15 lines
709 B
Swift
// RUN: %target-typecheck-verify-swift -enable-bare-slash-regex -disable-experimental-string-processing
|
|
// RUN: %target-typecheck-verify-swift -disable-experimental-string-processing -enable-bare-slash-regex
|
|
// RUN: %target-typecheck-verify-swift -enable-experimental-string-processing -disable-experimental-string-processing -enable-bare-slash-regex
|
|
|
|
prefix operator /
|
|
|
|
_ = /x/
|
|
// expected-error@-1 {{'/' is not a prefix unary operator}}
|
|
// expected-error@-2 {{cannot find 'x' in scope}}
|
|
// expected-error@-3 {{'/' is not a postfix unary operator}}
|
|
|
|
_ = #/x/# // expected-error {{expected expression in assignment}}
|
|
|
|
func foo(_ x: Regex<Substring>) {} // expected-error {{cannot find type 'Regex' in scope}}
|