From 1106c5d56af947eb90202bf4b9a12e8a80524765 Mon Sep 17 00:00:00 2001 From: Jisoo Park Date: Thu, 11 Apr 2024 10:58:33 +0900 Subject: [PATCH] Remove duplicate comma from Matchable selector warning [Cherry-picked 1ac72fd8e04d7a42ee17397c3b5dc1765218f23c] --- compiler/src/dotty/tools/dotc/reporting/messages.scala | 2 +- tests/pos-with-compiler-cc/dotc/reporting/messages.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/reporting/messages.scala b/compiler/src/dotty/tools/dotc/reporting/messages.scala index 16e0392764b6..d6d9bd8bc868 100644 --- a/compiler/src/dotty/tools/dotc/reporting/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/messages.scala @@ -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) = diff --git a/tests/pos-with-compiler-cc/dotc/reporting/messages.scala b/tests/pos-with-compiler-cc/dotc/reporting/messages.scala index 142ac63af0f3..cd5c5f67ff41 100644 --- a/tests/pos-with-compiler-cc/dotc/reporting/messages.scala +++ b/tests/pos-with-compiler-cc/dotc/reporting/messages.scala @@ -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) =