Skip to content

Commit 4ca1bd3

Browse files
committed
Rephrase explanation
1 parent f15d794 commit 4ca1bd3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: compiler/src/dotty/tools/dotc/reporting/messages.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -2520,8 +2520,8 @@ class ExtensionHasDefault(method: Symbol)(using Context)
25202520
def msg(using Context) =
25212521
i"""Extension method ${hl(method.name.toString)} should not have a default argument for its receiver."""
25222522
def explain(using Context) =
2523-
i"""Although extensions are ordinary methods, when they are invoked as a selection,
2524-
|the receiver cannot be omitted. A default argument for that parameter would never be used.
2523+
i"""The receiver cannot be omitted when an extension method is invoked as a selection.
2524+
|A default argument for that parameter would never be used in that case.
25252525
|An extension method can be invoked as a regular method, but if that is the intended usage,
25262526
|it should not be defined as an extension."""
25272527

Diff for: tests/warn/i12460.check

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
|---------------------------------------------------------------------------------------------------------------------
66
| Explanation (enabled by `-explain`)
77
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
8-
| Although extensions are ordinary methods, when they are invoked as a selection,
9-
| the receiver cannot be omitted. A default argument for that parameter would never be used.
8+
| The receiver cannot be omitted when an extension method is invoked as a selection.
9+
| A default argument for that parameter would never be used in that case.
1010
| An extension method can be invoked as a regular method, but if that is the intended usage,
1111
| it should not be defined as an extension.
1212
---------------------------------------------------------------------------------------------------------------------
@@ -17,8 +17,8 @@
1717
|---------------------------------------------------------------------------------------------------------------------
1818
| Explanation (enabled by `-explain`)
1919
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
20-
| Although extensions are ordinary methods, when they are invoked as a selection,
21-
| the receiver cannot be omitted. A default argument for that parameter would never be used.
20+
| The receiver cannot be omitted when an extension method is invoked as a selection.
21+
| A default argument for that parameter would never be used in that case.
2222
| An extension method can be invoked as a regular method, but if that is the intended usage,
2323
| it should not be defined as an extension.
2424
---------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)