Skip to content

Commit efbb1c6

Browse files
committed
Fix review comments re homogenizedArg
1 parent e332bd3 commit efbb1c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import typer.ImportInfo
1212
import config.Config
1313
import java.lang.Integer.toOctalString
1414
import config.Config.summarizeDepth
15+
import scala.util.control.NonFatal
1516
import scala.annotation.switch
1617

1718
class PlainPrinter(_ctx: Context) extends Printer {
@@ -69,11 +70,11 @@ class PlainPrinter(_ctx: Context) extends Printer {
6970
else tp
7071

7172
private def sameBound(lo: Type, hi: Type): Boolean =
72-
try lo =:= hi
73-
catch { case ex: Throwable => false }
73+
try ctx.typeComparer.isSameTypeWhenFrozen(lo, hi)
74+
catch { case NonFatal(ex) => false }
7475

7576
private def homogenizeArg(tp: Type) = tp match {
76-
case TypeBounds(lo, hi) if sameBound(lo, hi) => homogenize(hi)
77+
case TypeBounds(lo, hi) if homogenizedView && sameBound(lo, hi) => homogenize(hi)
7778
case _ => tp
7879
}
7980

0 commit comments

Comments
 (0)