Skip to content

Commit 91b540c

Browse files
committed
Also highlight non-string after showing them
1 parent 7963aad commit 91b540c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ object desugar {
659659
ctx.error(hl"""${"abstract"} modifier cannot be used for objects""", flagPos(Abstract))
660660
for (flag <- List(Sealed, Final)) {
661661
if (mods is flag)
662-
ctx.warning(hl"""${flag.toString} modifier is redundant for objects""", flagPos(flag))
662+
ctx.warning(hl"""$flag modifier is redundant for objects""", flagPos(flag))
663663
}
664664

665665
if (mods is Package)

compiler/src/dotty/tools/dotc/printing/Formatting.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ object Formatting {
8383
hl.show
8484
case hb: HighlightBuffer =>
8585
hb.toString
86-
case str: String if ctx.settings.color.value != "never" =>
87-
new String(SyntaxHighlighting(str).toArray)
86+
case str if ctx.settings.color.value != "never" =>
87+
new String(SyntaxHighlighting(super.showArg(str)).toArray)
8888
case _ => super.showArg(arg)
8989
}
9090
}

0 commit comments

Comments
 (0)