File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed
compiler/src/dotty/tools/dotc/printing Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,11 @@ class PlainPrinter(_ctx: Context) extends Printer {
4545 protected def debugPos : Boolean = ctx.settings.YdebugPos .value
4646
4747 def homogenize (tp : Type ): Type =
48- if (homogenizedView)
49- tp match {
48+ if (homogenizedView) {
49+ val a = tp.tryNormalize
50+ if (a.exists) {
51+ homogenize(a)
52+ } else tp match {
5053 case tp : ThisType if tp.cls.is(Package ) && ! tp.cls.isEffectiveRoot =>
5154 ctx.requiredPackage(tp.cls.fullName).termRef
5255 case tp : TypeVar if tp.isInstantiated =>
@@ -62,9 +65,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
6265 case AppliedType (tycon, args) =>
6366 tycon.dealias.appliedTo(args)
6467 case _ =>
65- tp
68+ tp
6669 }
67- else tp
70+ } else tp
6871
6972 private def sameBound (lo : Type , hi : Type ): Boolean =
7073 try ctx.typeComparer.isSameTypeWhenFrozen(lo, hi)
Original file line number Diff line number Diff line change 1+ 0
2+ (1)
3+ 0
4+ ()
Original file line number Diff line number Diff line change 1+ object Test extends App {
2+ def x [T ](xs : (T , T )): T = xs.head
3+ def x1 [T ](xs : (T , T )): Tuple1 [T ] = xs.tail
4+ def x2 [T ](xs : (T , T )): T = xs(0 )
5+ def x3 [T ](xs : (T , T )): Unit = xs(0 )
6+
7+ println(x((0 ,1 )))
8+ println(x1((0 ,1 )))
9+ println(x2((0 ,1 )))
10+ println(x3((0 ,1 )))
11+
12+ }
You can’t perform that action at this time.
0 commit comments