From a83edf5b42728096c239a8a173a1a96f5cea5a4e Mon Sep 17 00:00:00 2001 From: Abel Nieto Date: Fri, 31 Aug 2018 14:01:47 -0400 Subject: [PATCH] Patch library, since it always compiles in bootstrapped mode It's unclear why it wasn't failing before, but now it does. Patch the problem locally, but this patch will be subsumed when we make the compiler bootstrapping. --- library/src/scala/tasty/util/ShowSourceCode.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/src/scala/tasty/util/ShowSourceCode.scala b/library/src/scala/tasty/util/ShowSourceCode.scala index 2a47b063e9f0..84a60048a965 100644 --- a/library/src/scala/tasty/util/ShowSourceCode.scala +++ b/library/src/scala/tasty/util/ShowSourceCode.scala @@ -1142,7 +1142,9 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty case '"' => "\\\"" case '\'' => "\\\'" case '\\' => "\\\\" - case _ => if (ch.isControl) "\\0" + Integer.toOctalString(ch) else String.valueOf(ch) + case _ => + // TODO(abeln): remove `asInstanceOf` once we do the more general bootstrapping of the compiler. + if (ch.isControl) "\\0" + Integer.toOctalString(ch) else String.valueOf(ch).asInstanceOf[String] } private def escapedString(str: String): String = str flatMap escapedChar