Files
swift-mirror/test/StringProcessing/Frontend/disable-flag.swift
Rintaro Ishizaki 9fc1521aeb [Macros/Parser] Attributes on MacroExpansionDecl
* Parse `#<identifier>` attribute list as a `MacroExpansionDecl`
  regardless of the position
* Diagnose whitespaces between `#` and the macro name.
* Correctly attach attributes to `MacroExpansionDecl`
* Fix `OrigDeclAttributes` to handle modifiers (use `getLocation()`
  instead of `AtLoc`.)

Type checking is a TODO

rdar://107386648
2023-05-11 12:04:35 -07:00

15 lines
703 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 a macro identifier}}
func foo(_ x: Regex<Substring>) {} // expected-error {{cannot find type 'Regex' in scope}}