We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 96e7f7d + e54524a commit eeff384Copy full SHA for eeff384
compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
@@ -326,6 +326,8 @@ class PlainPrinter(_ctx: Context) extends Printer {
326
"} at " ~ preText
327
case mt: MethodType =>
328
toTextGlobal(mt)
329
+ case tp: ExprType =>
330
+ ": => " ~ toTextGlobal(tp.widenExpr)
331
case tp =>
332
": " ~ toTextGlobal(tp)
333
}
compiler/test/dotty/tools/repl/ReplCompilerTests.scala
@@ -120,4 +120,9 @@ class ReplCompilerTests extends ReplTest {
120
compile("(x: Int) => println(x)")
121
assertTrue(storedOutput().startsWith("val res0: Int => Unit ="))
122
123
+
124
+ @Test def byNameParam: Unit = fromInitialState { implicit state =>
125
+ compile("def f(g: => Int): Int = g")
126
+ assertTrue(storedOutput().startsWith("def f(g: => Int): Int"))
127
+ }
128
0 commit comments