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) {
222
222
case _ => super .toText(tp)
223
223
}
224
224
else super .toText(tp)
225
- case tp : ExprType =>
226
- exprToText(tp)
227
225
case ErasedValueType (tycon, underlying) =>
228
226
" ErasedValueType(" ~ toText(tycon) ~ " , " ~ toText(underlying) ~ " )"
229
227
case tp : ClassInfo =>
Original file line number Diff line number Diff line change @@ -19,10 +19,6 @@ class ReplPrinter(_ctx: Context) extends DecompilerPrinter(_ctx) {
19
19
if (name.isReplAssignName) name.decode.toString.takeWhile(_ != '$' )
20
20
else super .nameString(name)
21
21
22
- override protected def exprToText (tp : ExprType ): Text =
23
- if (debugPrint) super .exprToText(tp)
24
- else " : " ~ toText(tp.resType)
25
-
26
22
override def toText (sym : Symbol ): Text =
27
23
if (sym.name.isReplAssignName) nameString(sym.name)
28
24
else if (debugPrint) super .toText(sym)
@@ -38,7 +34,12 @@ class ReplPrinter(_ctx: Context) extends DecompilerPrinter(_ctx) {
38
34
override def dclText (sym : Symbol ): Text = if (debugPrint) super .dclText(sym) else
39
35
(" lazy" : Text ).provided(sym.is(Lazy )) ~~
40
36
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
+ }
42
43
else if (sym.isType && sym.info.isTypeAlias) toText(sym.info)
43
44
else if (sym.isType || sym.isClass) " "
44
45
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