File tree 3 files changed +23
-4
lines changed
compiler/src/dotty/tools/dotc/printing
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 {
45
45
protected def debugPos : Boolean = ctx.settings.YdebugPos .value
46
46
47
47
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 {
50
53
case tp : ThisType if tp.cls.is(Package ) && ! tp.cls.isEffectiveRoot =>
51
54
ctx.requiredPackage(tp.cls.fullName).termRef
52
55
case tp : TypeVar if tp.isInstantiated =>
@@ -62,9 +65,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
62
65
case AppliedType (tycon, args) =>
63
66
tycon.dealias.appliedTo(args)
64
67
case _ =>
65
- tp
68
+ tp
66
69
}
67
- else tp
70
+ } else tp
68
71
69
72
private def sameBound (lo : Type , hi : Type ): Boolean =
70
73
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