Skip to content

Commit 25af1de

Browse files
committed
Switch to new syntax for printing method types
1 parent 40c9bc8 commit 25af1de

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,13 @@ class PlainPrinter(_ctx: Context) extends Printer {
186186
"<noprefix>"
187187
case tp: MethodType =>
188188
changePrec(GlobalPrec) {
189-
(if (tp.isContextualMethod) " given" else "") ~
190-
(if (tp.isErasedMethod) " erased" else "") ~~
191-
("(" + (if (tp.isImplicitMethod && !tp.isContextualMethod) "implicit " else "")) ~
192-
paramsText(tp) ~
193-
(if (tp.resultType.isInstanceOf[MethodType]) ")" else "): ") ~
194-
toText(tp.resultType)
189+
"("
190+
~ "given ".provided(tp.isContextualMethod)
191+
~ "erased ".provided(tp.isErasedMethod)
192+
~ "implicit ".provided(tp.isImplicitMethod && !tp.isContextualMethod)
193+
~ paramsText(tp)
194+
~ (if tp.resultType.isInstanceOf[MethodType] then ")" else "): "
195+
~ toText(tp.resultType)
195196
}
196197
case tp: ExprType =>
197198
changePrec(GlobalPrec) { "=> " ~ toText(tp.resultType) }

0 commit comments

Comments
 (0)