Skip to content

Commit

Permalink
More words in message
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Martres <[email protected]>
  • Loading branch information
som-snytt and smarter committed Apr 4, 2024
1 parent 613824c commit fdb33a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/reporting/messages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2456,7 +2456,7 @@ class ExtensionNullifiedByMember(method: Symbol, target: Symbol)(using Context)
def kind = MessageKind.PotentialIssue
def msg(using Context) =
i"""Extension method ${hl(method.name.toString)} will never be selected
|because ${hl(target.name.toString)} already has a member with the same name."""
|because ${hl(target.name.toString)} already has a member with the same name and compatible parameter types."""
def explain(using Context) =
i"""An extension method can be invoked as a regular method, but if that is intended,
|it should not be defined as an extension.
Expand Down
24 changes: 12 additions & 12 deletions tests/warn/i16743.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,83 +2,83 @@
30 | def t = 27 // warn
| ^
| Extension method t will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:32:6 --------------------------------------------------------
32 | def g(x: String)(i: Int): String = x*i // warn
| ^
| Extension method g will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:33:6 --------------------------------------------------------
33 | def h(x: String): String = x // warn
| ^
| Extension method h will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:35:6 --------------------------------------------------------
35 | def j(x: Any, y: Int): String = (x.toString)*y // warn
| ^
| Extension method j will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:36:6 --------------------------------------------------------
36 | def k(x: String): String = x // warn
| ^
| Extension method k will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:38:6 --------------------------------------------------------
38 | def m(using String): String = "m" + summon[String] // warn
| ^
| Extension method m will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:39:6 --------------------------------------------------------
39 | def n(using String): String = "n" + summon[String] // warn
| ^
| Extension method n will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:40:6 --------------------------------------------------------
40 | def o: String = "42" // warn
| ^
| Extension method o will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:41:6 --------------------------------------------------------
41 | def u: Int = 27 // warn
| ^
| Extension method u will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:44:6 --------------------------------------------------------
44 | def at: Int = 42 // warn
| ^
| Extension method at will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:46:6 --------------------------------------------------------
46 | def x(using String)(n: Int): Int = summon[String].toInt + n // warn
| ^
| Extension method x will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:47:6 --------------------------------------------------------
47 | def y(using String)(s: String): String = s + summon[String] // warn
| ^
| Extension method y will never be selected
| because T already has a member with the same name.
| because T already has a member with the same name and compatible parameter types.
|
| longer explanation available when compiling with `-explain`

0 comments on commit fdb33a8

Please sign in to comment.