diff --git a/compiler/src/dotty/tools/dotc/reporting/messages.scala b/compiler/src/dotty/tools/dotc/reporting/messages.scala index 11069cb5ac79..d33010dcd09e 100644 --- a/compiler/src/dotty/tools/dotc/reporting/messages.scala +++ b/compiler/src/dotty/tools/dotc/reporting/messages.scala @@ -1112,7 +1112,7 @@ object messages { def explain = if (Tokens.isIdentifier(expected) && Tokens.isKeyword(found)) s""" - |If you want to use $foundText as identifier, you may put it in backticks: `$foundText`.""".stripMargin + |If you want to use $foundText as identifier, you may put it in backticks: `${Tokens.tokenString(found)}`.""".stripMargin else "" }