From f46dd7bbcbaac5d8a70ae331ec7bc426e5086223 Mon Sep 17 00:00:00 2001 From: adpi2 Date: Mon, 29 Jun 2020 14:42:16 +0200 Subject: [PATCH] Improve explain message when token expected --- compiler/src/dotty/tools/dotc/reporting/messages.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 "" }