aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools')
-rw-r--r--src/dotty/tools/dotc/printing/PlainPrinter.scala4
-rw-r--r--src/dotty/tools/dotc/printing/RefinedPrinter.scala4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/printing/PlainPrinter.scala b/src/dotty/tools/dotc/printing/PlainPrinter.scala
index 07819ef77..e86137c47 100644
--- a/src/dotty/tools/dotc/printing/PlainPrinter.scala
+++ b/src/dotty/tools/dotc/printing/PlainPrinter.scala
@@ -187,6 +187,8 @@ class PlainPrinter(_ctx: Context) extends Printer {
}
case tp: ExprType =>
changePrec(GlobalPrec) { "=> " ~ toText(tp.resultType) }
+ case tp: TypeLambda =>
+ typeLambdaText(tp.paramNames.map(_.toString), tp.variances, tp.paramBounds, tp.resultType)
case tp: PolyType =>
def paramText(name: TypeName, bounds: TypeBounds) =
toText(polyParamName(name)) ~ polyHash(tp) ~ toText(bounds)
@@ -199,8 +201,6 @@ class PlainPrinter(_ctx: Context) extends Printer {
toText(polyParamName(pt.paramNames(n))) ~ polyHash(pt)
case AnnotatedType(tpe, annot) =>
toTextLocal(tpe) ~ " " ~ toText(annot)
- case tp: TypeLambda =>
- typeLambdaText(tp.paramNames.map(_.toString), tp.variances, tp.paramBounds, tp.resultType)
case HKApply(tycon, args) =>
toTextLocal(tycon) ~ "[!" ~ Text(args.map(argText), ", ") ~ "]"
case tp: TypeVar =>
diff --git a/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/src/dotty/tools/dotc/printing/RefinedPrinter.scala
index 91f896da2..d6ce67cef 100644
--- a/src/dotty/tools/dotc/printing/RefinedPrinter.scala
+++ b/src/dotty/tools/dotc/printing/RefinedPrinter.scala
@@ -383,7 +383,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
case AppliedTypeTree(tpt, args) =>
toTextLocal(tpt) ~ "[" ~ Text(args map argText, ", ") ~ "]"
case TypeLambdaTree(tparams, body) =>
- tparamsText(tparams) ~ " -> " ~ toText(body)
+ changePrec(GlobalPrec) {
+ tparamsText(tparams) ~ " -> " ~ toText(body)
+ }
case ByNameTypeTree(tpt) =>
"=> " ~ toTextLocal(tpt)
case TypeBoundsTree(lo, hi) =>