diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-11-30 15:02:14 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-11-30 16:55:59 +0100 |
commit | 8b7a7ea0cf25b55ea842fe1f299e1576b8bc3e5a (patch) | |
tree | 720b5bb52e2d3225e11ff2f0a89eab8278c307d2 /compiler | |
parent | 8bb9c849c6e918c31dea5910498319e96bcadd6b (diff) | |
download | dotty-8b7a7ea0cf25b55ea842fe1f299e1576b8bc3e5a.tar.gz dotty-8b7a7ea0cf25b55ea842fe1f299e1576b8bc3e5a.tar.bz2 dotty-8b7a7ea0cf25b55ea842fe1f299e1576b8bc3e5a.zip |
Print List and Map abbreviated
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala | 9 |
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 { |