aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-12-01 14:02:46 +0100
committerFelix Mulder <felix.mulder@gmail.com>2016-12-01 14:02:46 +0100
commit454f09e5741c72f8edd6040585eb07588bf2763e (patch)
treeea93db40e79451d887adefccbd495b39c707219d
parentd63e971e2cf5f134d1a0c8bab09e7deca4e9bc43 (diff)
downloaddotty-454f09e5741c72f8edd6040585eb07588bf2763e.tar.gz
dotty-454f09e5741c72f8edd6040585eb07588bf2763e.tar.bz2
dotty-454f09e5741c72f8edd6040585eb07588bf2763e.zip
Fix literal type printing
-rw-r--r--compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala3
1 files changed, 3 insertions, 0 deletions
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)