aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-02-14 16:38:48 +0100
committerMartin Odersky <odersky@gmail.com>2017-02-14 16:52:13 +0100
commit17469b82ca7afc5376bc3906bb5b64d10f38a100 (patch)
treea2f82eb455c47af697a5786b1eb6a70f7a2ad14a /compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
parent47901c09885f8931d82a3bbc469985a50f790091 (diff)
downloaddotty-17469b82ca7afc5376bc3906bb5b64d10f38a100.tar.gz
dotty-17469b82ca7afc5376bc3906bb5b64d10f38a100.tar.bz2
dotty-17469b82ca7afc5376bc3906bb5b64d10f38a100.zip
Tweak printing of polymrophic methods
Omit the `=>' if a PolyType has a MethodType as result type.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala b/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
index ac25f7cfd..1c3ff8ea0 100644
--- a/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
+++ b/compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
@@ -177,7 +177,8 @@ class PlainPrinter(_ctx: Context) extends Printer {
varianceString(variance) ~ name.toString ~ toText(bounds)
changePrec(GlobalPrec) {
"[" ~ Text((tp.variances, tp.paramNames, tp.paramBounds).zipped.map(paramText), ", ") ~
- "] => " ~ toTextGlobal(tp.resultType)
+ "]" ~ (" => " provided !tp.resultType.isInstanceOf[MethodType]) ~
+ toTextGlobal(tp.resultType)
}
case tp: PolyParam =>
polyParamNameString(tp) ~ polyHash(tp.binder)