aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"
| }