Skip to content

Commit 859cfe5

Browse files
committed
Don't recognize type bounds as lambda abstractions
Printing bounds omits the "<:" otherwise.
1 parent dfa8fea commit 859cfe5

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/dotty/tools/dotc/core/TypeApplications.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ object TypeApplications {
6666
val variances = cls.typeParams.map(_.variance)
6767
val argBounds = prefix.argInfos.map(_.bounds)
6868
Some((variances, argBounds, app.refinedInfo))
69-
case TypeBounds(lo, hi) =>
70-
unapply(hi)
7169
case _ =>
7270
None
7371
}

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,13 @@ class PlainPrinter(_ctx: Context) extends Printer {
266266
homogenize(tp) match {
267267
case tp @ TypeBounds(lo, hi) =>
268268
if (lo eq hi) {
269-
val eql =
270-
if (tp.variance == 1) " =+ "
271-
else if (tp.variance == -1) " =- "
272-
else " = "
269+
val eql =
270+
if (tp.variance == 1) " =+ "
271+
else if (tp.variance == -1) " =- "
272+
else " = "
273273
eql ~ toText(lo)
274-
} else
274+
}
275+
else
275276
(if (lo isRef defn.NothingClass) Text() else " >: " ~ toText(lo)) ~
276277
(if (hi isRef defn.AnyClass) Text() else " <: " ~ toText(hi))
277278
case tp @ ClassInfo(pre, cls, cparents, decls, selfInfo) =>

0 commit comments

Comments
 (0)