Skip to content

Commit c3f1bd9

Browse files
committed
Print full constant type in repl
1 parent fba25d4 commit c3f1bd9

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

compiler/src/dotty/tools/dotc/printing/UserFacingPrinter.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class UserFacingPrinter(_ctx: Context) extends RefinedPrinter(_ctx) {
2323

2424
override def toText(tp: Type): Text = tp match {
2525
case ExprType(result) => ":" ~~ toText(result)
26-
case tp: ConstantType => toText(tp.value)
2726
case tp => super.toText(tp)
2827
}
2928
}

compiler/test-resources/repl/defs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ def baz(): Int
77
scala> def qux(): Int = 2
88
def qux(): Int
99
scala> def id(x: 4): 4 = x
10-
def id(x: 4): 4
10+
def id(x: Int(4)): Int(4)
1111
scala> id(4)
1212
val res0: Int = 4

compiler/test-resources/type-printer/defs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ def baz[A](a: A): A
77
scala> def qux[A](a: A): a.type = a
88
def qux[A](a: A): a.type
99
scala> def singleton: 1 = 1
10-
def singleton: 1
10+
def singleton: Int(1)

0 commit comments

Comments
 (0)