Skip to content

Commit

Permalink
Backport "Remove duplicate comma from Matchable selector warning" to …
Browse files Browse the repository at this point in the history
…LTS (#21057)

Backports #20159 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Jul 5, 2024
2 parents 6beee6a + 1106c5d commit 8b91d31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 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 @@ -921,7 +921,7 @@ class MatchableWarning(tp: Type, pattern: Boolean)(using Context)
extends TypeMsg(MatchableWarningID) {
def msg(using Context) =
val kind = if pattern then "pattern selector" else "value"
i"""${kind} should be an instance of Matchable,,
i"""${kind} should be an instance of Matchable,
|but it has unmatchable type $tp instead"""

def explain(using Context) =
Expand Down
2 changes: 1 addition & 1 deletion tests/pos-with-compiler-cc/dotc/reporting/messages.scala
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ class MatchableWarning(tp: Type, pattern: Boolean)(using DetachedContext)
extends TypeMsg(MatchableWarningID) {
def msg(using Context) =
val kind = if pattern then "pattern selector" else "value"
i"""${kind} should be an instance of Matchable,,
i"""${kind} should be an instance of Matchable,
|but it has unmatchable type $tp instead"""

def explain(using Context) =
Expand Down

0 comments on commit 8b91d31

Please sign in to comment.