Skip to content

Commit

Permalink
Update warning message per review
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed Jun 25, 2020
1 parent 3240841 commit 12f1c41
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2817,7 +2817,7 @@ self =>
}
if (nme.isEncodedUnary(name) && vparamss.nonEmpty) {
val tpeStr = if (restype.isEmpty) "" else s" : $restype"
def unaryMsg(what: String) = s"empty-paren (nilary) prefix unary operator is $what: instead, remove () to declare as `def ${name.decodedName}$tpeStr`"
def unaryMsg(what: String) = s"unary prefix operator definition with empty parameter list is $what: instead, remove () to declare as `def ${name.decodedName}$tpeStr`"
vparamss match {
case List(List()) =>
if (currentRun.isScala3) syntaxError(nameOffset, unaryMsg("unsupported"))
Expand Down
2 changes: 1 addition & 1 deletion test/files/neg/prefix-unary-nilary-deprecation.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prefix-unary-nilary-deprecation.scala:4: warning: empty-paren (nilary) prefix unary operator is deprecated: instead, remove () to declare as `def unary_~ : Foo`
prefix-unary-nilary-deprecation.scala:4: warning: unary prefix operator definition with empty parameter list is deprecated: instead, remove () to declare as `def unary_~ : Foo`
def unary_~() : Foo = this
^
prefix-unary-nilary-deprecation.scala:10: warning: Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method unary_~,
Expand Down
2 changes: 1 addition & 1 deletion test/files/neg/prefix-unary-nilary-removal.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prefix-unary-nilary-removal.scala:4: error: empty-paren (nilary) prefix unary operator is unsupported: instead, remove () to declare as `def unary_~ : Foo`
prefix-unary-nilary-removal.scala:4: error: unary prefix operator definition with empty parameter list is unsupported: instead, remove () to declare as `def unary_~ : Foo`
def unary_~() : Foo = this
^
1 error

0 comments on commit 12f1c41

Please sign in to comment.