From 454f09e5741c72f8edd6040585eb07588bf2763e Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Thu, 1 Dec 2016 14:02:46 +0100 Subject: Fix literal type printing --- compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala') diff --git a/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala b/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala index e0fda8258..7fe3d815d 100644 --- a/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala +++ b/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala @@ -685,12 +685,15 @@ class CompilingInterpreter( private val ListReg = """^.*List\[(\w+)\]$""".r private val MapReg = """^.*Map\[(\w+),[ ]*(\w+)\]$""".r + private val LitReg = """^.*\((.+)\)$""".r private def resultExtractor(req: Request, varName: Name): String = { val prettyName = varName.decode val varType = string2code(req.typeOf(varName)) match { case ListReg(param) => s"List[$param]" case MapReg(k, v) => s"Map[$k, $v]" + case LitReg(lit) => lit + case x if x.lastOption == Some('$') => x.init + ".type" case x => x } val fullPath = req.fullPath(varName) -- cgit v1.2.3