File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
src/dotty/tools/dotc/printing Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -222,8 +222,6 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
222222 case _ => super .toText(tp)
223223 }
224224 else super .toText(tp)
225- case tp : ExprType =>
226- exprToText(tp)
227225 case ErasedValueType (tycon, underlying) =>
228226 " ErasedValueType(" ~ toText(tycon) ~ " , " ~ toText(underlying) ~ " )"
229227 case tp : ClassInfo =>
Original file line number Diff line number Diff line change @@ -19,10 +19,6 @@ class ReplPrinter(_ctx: Context) extends DecompilerPrinter(_ctx) {
1919 if (name.isReplAssignName) name.decode.toString.takeWhile(_ != '$' )
2020 else super .nameString(name)
2121
22- override protected def exprToText (tp : ExprType ): Text =
23- if (debugPrint) super .exprToText(tp)
24- else " : " ~ toText(tp.resType)
25-
2622 override def toText (sym : Symbol ): Text =
2723 if (sym.name.isReplAssignName) nameString(sym.name)
2824 else if (debugPrint) super .toText(sym)
@@ -38,7 +34,12 @@ class ReplPrinter(_ctx: Context) extends DecompilerPrinter(_ctx) {
3834 override def dclText (sym : Symbol ): Text = if (debugPrint) super .dclText(sym) else
3935 (" lazy" : Text ).provided(sym.is(Lazy )) ~~
4036 toText(sym) ~ {
41- if (sym.is(Method )) toText(sym.info)
37+ if (sym.is(Method )) {
38+ sym.info match {
39+ case tp : ExprType => " :" ~~ toText(tp.resType)
40+ case _ => toText(sym.info)
41+ }
42+ }
4243 else if (sym.isType && sym.info.isTypeAlias) toText(sym.info)
4344 else if (sym.isType || sym.isClass) " "
4445 else " :" ~~ toText(sym.info)
Original file line number Diff line number Diff line change 1+ scala> def foo(x: => Int) = x.toString
2+ def foo(x: => Int): String
3+ scala> def bar: (=> Int) => String = x => x.toString
4+ def bar: (=> Int) => String
5+ scala> def baz: (Int => String) = x => x.toString
6+ def baz: Int => String
7+ scala> lazy val qux: ((=> Int) => String) = x => x.toString
8+ lazy val qux: (=> Int) => String
You can’t perform that action at this time.
0 commit comments