Skip to content

Commit 493b4c5

Browse files
committed
Re-allow prefix operators containing /
1 parent 166688d commit 493b4c5

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

include/swift/AST/DiagnosticsParse.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ ERROR(forbidden_extended_escaping_string,none,
9494
ERROR(regex_literal_parsing_error,none,
9595
"%0", (StringRef))
9696

97-
ERROR(prefix_slash_not_allowed,none,
98-
"prefix operator may not contain '/'", ())
99-
10097
//------------------------------------------------------------------------------
10198
// MARK: Lexer diagnostics
10299
//------------------------------------------------------------------------------

lib/Parse/ParseDecl.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8539,13 +8539,6 @@ Parser::parseDeclOperator(ParseDeclOptions Flags, DeclAttributes &Attributes) {
85398539
Tok.getText().front() == '!'))
85408540
diagnose(Tok, diag::postfix_operator_name_cannot_start_with_unwrap);
85418541

8542-
// Prefix operators may not contain the `/` character when `/.../` regex
8543-
// literals are enabled.
8544-
if (Context.LangOpts.EnableBareSlashRegexLiterals) {
8545-
if (Attributes.hasAttribute<PrefixAttr>() && Tok.getText().contains("/"))
8546-
diagnose(Tok, diag::prefix_slash_not_allowed);
8547-
}
8548-
85498542
// A common error is to try to define an operator with something in the
85508543
// unicode plane considered to be an operator, or to try to define an
85518544
// operator like "not". Analyze and diagnose this specifically.

0 commit comments

Comments
 (0)