Skip to content

Commit

Permalink
Fix pretty print
Browse files Browse the repository at this point in the history
  • Loading branch information
Sporarum committed Jan 22, 2022
1 parent b9ac06f commit 1a85e94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
~ keywordText("erased ").provided(tp.isErasedMethod)
~ keywordText("implicit ").provided(tp.isImplicitMethod && !tp.isContextualMethod)
~ paramsText(tp)
~ (if tp.resultType.isInstanceOf[MethodType] then ")" else "): ")
~ (if tp.resultType.isInstanceOf[MethodOrPoly] then ")" else "): ")
~ toText(tp.resultType)
}
case tp: ExprType =>
Expand All @@ -223,7 +223,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
case tp: PolyType =>
changePrec(GlobalPrec) {
"[" ~ paramsText(tp) ~ "]" ~ lambdaHash(tp) ~
(Str(" => ") provided !tp.resultType.isInstanceOf[MethodType]) ~
(Str(" => ") provided !tp.resultType.isInstanceOf[MethodOrPoly]) ~
toTextGlobal(tp.resultType)
}
case AnnotatedType(tpe, annot) =>
Expand Down Expand Up @@ -418,7 +418,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
(if (isParameter) ": => " else ": ") ~ toTextGlobal(tp.widenExpr)
case tp: PolyType =>
"[" ~ paramsText(tp) ~ "]"
~ (Str(": ") provided !tp.resultType.isInstanceOf[MethodType])
~ (Str(": ") provided !tp.resultType.isInstanceOf[MethodOrPoly])
~ toTextGlobal(tp.resultType)
case tp =>
": " ~ toTextGlobal(tp)
Expand Down

0 comments on commit 1a85e94

Please sign in to comment.