aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-11-30 15:02:14 +0100
committerFelix Mulder <felix.mulder@gmail.com>2016-11-30 16:55:59 +0100
commit8b7a7ea0cf25b55ea842fe1f299e1576b8bc3e5a (patch)
tree720b5bb52e2d3225e11ff2f0a89eab8278c307d2 /compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
parent8bb9c849c6e918c31dea5910498319e96bcadd6b (diff)
downloaddotty-8b7a7ea0cf25b55ea842fe1f299e1576b8bc3e5a.tar.gz
dotty-8b7a7ea0cf25b55ea842fe1f299e1576b8bc3e5a.tar.bz2
dotty-8b7a7ea0cf25b55ea842fe1f299e1576b8bc3e5a.zip
Print List and Map abbreviated
Diffstat (limited to 'compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala b/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
index ad718100c..d193148ef 100644
--- a/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
+++ b/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
@@ -683,9 +683,16 @@ class CompilingInterpreter(
code.print(resultExtractors.mkString(""))
}
+ private val ListReg = """^.*List\[(\w+)\]$""".r
+ private val MapReg = """^.*Map\[(\w+),[ ]*(\w+)\]$""".r
+
private def resultExtractor(req: Request, varName: Name): String = {
val prettyName = varName.decode
- val varType = string2code(req.typeOf(varName))
+ val varType = string2code(req.typeOf(varName)) match {
+ case ListReg(param) => s"List[$param]"
+ case MapReg(k, v) => s"Map[$k, $v]"
+ case x => x
+ }
val fullPath = req.fullPath(varName)
val varOrVal = statement match {