We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 12be03e + db2ecac commit 592f267Copy full SHA for 592f267
compiler/src/dotty/tools/dotc/repl/CompilingInterpreter.scala
@@ -724,7 +724,7 @@ class CompilingInterpreter(
724
| if ($fullPath.asInstanceOf[AnyRef] != null) {
725
| (if ($fullPath.toString().contains('\\n')) "\\n" else "") + {
726
| import dotty.Show._
727
- | $fullPath.show /*toString()*/ + "\\n"
+ | (new ShowValue($fullPath)).show /*toString()*/ + "\\n"
728
| }
729
| } else {
730
| "null\\n"
tests/repl/showMethod.check
@@ -0,0 +1,9 @@
1
+scala> class A { def show = "hello"; override def toString = "A" }
2
+defined class A
3
+scala> new A
4
+val res0: A = A
5
+scala> class B { def show() = "hello"; override def toString = "B" }
6
+defined class B
7
+scala> new B
8
+val res1: B = B
9
+scala> :quit
0 commit comments