aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-11-30 15:01:56 +0100
committerFelix Mulder <felix.mulder@gmail.com>2016-11-30 16:55:59 +0100
commit8bb9c849c6e918c31dea5910498319e96bcadd6b (patch)
tree710b50eb8c48112cfecf871b8bd381e3bea3b101
parentc619f762b966bc0d2f4de30b001eb7df76c5a347 (diff)
downloaddotty-8bb9c849c6e918c31dea5910498319e96bcadd6b.tar.gz
dotty-8bb9c849c6e918c31dea5910498319e96bcadd6b.tar.bz2
dotty-8bb9c849c6e918c31dea5910498319e96bcadd6b.zip
Make repl use show instances where possible
-rw-r--r--compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala17
1 files changed, 15 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala b/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
index f269fef64..ad718100c 100644
--- a/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
+++ b/compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
@@ -695,8 +695,21 @@ class CompilingInterpreter(
s""" + "$varOrVal $prettyName: $varType = " + {
| if ($fullPath.asInstanceOf[AnyRef] != null) {
- | (if ($fullPath.toString().contains('\\n')) "\\n" else "") +
- | $fullPath.toString() + "\\n"
+ | (if ($fullPath.toString().contains('\\n')) "\\n" else "") + {
+ | import dotty.Show._
+ | if ("$varType".matches(".*Map\\\\[.*,.*\\\\]")) {
+ | import dotty.Show.Map._
+ | $fullPath.show /*toString()*/ + "\\n"
+ | } else if ("$varType".matches(".*List\\\\[.*\\\\]")) {
+ | import dotty.Show.List._
+ | $fullPath.show /*toString()*/ + "\\n"
+ | } else if ("$varType".matches(".*Option\\\\[.*\\\\]")) {
+ | import dotty.Show.Option._
+ | $fullPath.show /*toString()*/ + "\\n"
+ | } else {
+ | $fullPath.show /*toString()*/ + "\\n"
+ | }
+ | }
| } else {
| "null\\n"
| }