Skip to content

Conversation

som-snytt
Copy link
Contributor

Introduce -Wsyntax to warn about syntax warts.

Warns about - 42 (the misconception that space is significant);
and -42.abs (the misconception that it parses the same as -x.abs, i.e. -(42.abs)).

Tweak prefixExpr to exclude subsequent expression on the next line.

Tweak simplePattern to exclude backquoted hyphen as unary minus.

Fixes #7910
Fixes #24162

@som-snytt
Copy link
Contributor Author

Resuscitates #12459

Addresses the question at https://contributors.scala-lang.org/t/functional-syntax/5062/1

Could use code actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backquote quirk in pattern Unary identifier has undue expectation of subsequent expression
1 participant