Skip to content

Commit fdb33a8

Browse files
som-snyttsmarter
andcommitted
More words in message
Co-authored-by: Guillaume Martres <[email protected]>
1 parent 613824c commit fdb33a8

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

compiler/src/dotty/tools/dotc/reporting/messages.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -2456,7 +2456,7 @@ class ExtensionNullifiedByMember(method: Symbol, target: Symbol)(using Context)
24562456
def kind = MessageKind.PotentialIssue
24572457
def msg(using Context) =
24582458
i"""Extension method ${hl(method.name.toString)} will never be selected
2459-
|because ${hl(target.name.toString)} already has a member with the same name."""
2459+
|because ${hl(target.name.toString)} already has a member with the same name and compatible parameter types."""
24602460
def explain(using Context) =
24612461
i"""An extension method can be invoked as a regular method, but if that is intended,
24622462
|it should not be defined as an extension.

tests/warn/i16743.check

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,83 @@
22
30 | def t = 27 // warn
33
| ^
44
| Extension method t will never be selected
5-
| because T already has a member with the same name.
5+
| because T already has a member with the same name and compatible parameter types.
66
|
77
| longer explanation available when compiling with `-explain`
88
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:32:6 --------------------------------------------------------
99
32 | def g(x: String)(i: Int): String = x*i // warn
1010
| ^
1111
| Extension method g will never be selected
12-
| because T already has a member with the same name.
12+
| because T already has a member with the same name and compatible parameter types.
1313
|
1414
| longer explanation available when compiling with `-explain`
1515
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:33:6 --------------------------------------------------------
1616
33 | def h(x: String): String = x // warn
1717
| ^
1818
| Extension method h will never be selected
19-
| because T already has a member with the same name.
19+
| because T already has a member with the same name and compatible parameter types.
2020
|
2121
| longer explanation available when compiling with `-explain`
2222
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:35:6 --------------------------------------------------------
2323
35 | def j(x: Any, y: Int): String = (x.toString)*y // warn
2424
| ^
2525
| Extension method j will never be selected
26-
| because T already has a member with the same name.
26+
| because T already has a member with the same name and compatible parameter types.
2727
|
2828
| longer explanation available when compiling with `-explain`
2929
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:36:6 --------------------------------------------------------
3030
36 | def k(x: String): String = x // warn
3131
| ^
3232
| Extension method k will never be selected
33-
| because T already has a member with the same name.
33+
| because T already has a member with the same name and compatible parameter types.
3434
|
3535
| longer explanation available when compiling with `-explain`
3636
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:38:6 --------------------------------------------------------
3737
38 | def m(using String): String = "m" + summon[String] // warn
3838
| ^
3939
| Extension method m will never be selected
40-
| because T already has a member with the same name.
40+
| because T already has a member with the same name and compatible parameter types.
4141
|
4242
| longer explanation available when compiling with `-explain`
4343
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:39:6 --------------------------------------------------------
4444
39 | def n(using String): String = "n" + summon[String] // warn
4545
| ^
4646
| Extension method n will never be selected
47-
| because T already has a member with the same name.
47+
| because T already has a member with the same name and compatible parameter types.
4848
|
4949
| longer explanation available when compiling with `-explain`
5050
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:40:6 --------------------------------------------------------
5151
40 | def o: String = "42" // warn
5252
| ^
5353
| Extension method o will never be selected
54-
| because T already has a member with the same name.
54+
| because T already has a member with the same name and compatible parameter types.
5555
|
5656
| longer explanation available when compiling with `-explain`
5757
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:41:6 --------------------------------------------------------
5858
41 | def u: Int = 27 // warn
5959
| ^
6060
| Extension method u will never be selected
61-
| because T already has a member with the same name.
61+
| because T already has a member with the same name and compatible parameter types.
6262
|
6363
| longer explanation available when compiling with `-explain`
6464
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:44:6 --------------------------------------------------------
6565
44 | def at: Int = 42 // warn
6666
| ^
6767
| Extension method at will never be selected
68-
| because T already has a member with the same name.
68+
| because T already has a member with the same name and compatible parameter types.
6969
|
7070
| longer explanation available when compiling with `-explain`
7171
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:46:6 --------------------------------------------------------
7272
46 | def x(using String)(n: Int): Int = summon[String].toInt + n // warn
7373
| ^
7474
| Extension method x will never be selected
75-
| because T already has a member with the same name.
75+
| because T already has a member with the same name and compatible parameter types.
7676
|
7777
| longer explanation available when compiling with `-explain`
7878
-- [E194] Potential Issue Warning: tests/warn/i16743.scala:47:6 --------------------------------------------------------
7979
47 | def y(using String)(s: String): String = s + summon[String] // warn
8080
| ^
8181
| Extension method y will never be selected
82-
| because T already has a member with the same name.
82+
| because T already has a member with the same name and compatible parameter types.
8383
|
8484
| longer explanation available when compiling with `-explain`

0 commit comments

Comments
 (0)