File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
compiler/src/dotty/tools/dotc/printing Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,9 @@ class PlainPrinter(_ctx: Context) extends Printer {
6161 homogenize(tp.info)
6262 case tp : LazyRef =>
6363 homogenize(tp.ref)
64- case AppliedType (tycon, args) =>
65- tycon.dealias.appliedTo(args)
64+ case tp @ AppliedType (tycon, args) =>
65+ if (defn.isCompiletimeAppliedType(tycon.typeSymbol)) tp.tryCompiletimeConstantFold
66+ else tycon.dealias.appliedTo(args)
6667 case _ =>
6768 tp
6869 }
Original file line number Diff line number Diff line change 1+ import scala .compiletime .ops .int ._
2+ import scala .annotation .infix
3+
4+ object Test {
5+ class Vec [S <: Int ] {
6+ @ infix def concat [RS <: Int ](that : Vec [RS ]) : Vec [S + RS ] = new Vec [S + RS ]
7+ }
8+
9+ val v1 = new Vec [1 ]
10+ val v2 = new Vec [2 ]
11+ val v3 : Vec [3 ] = v1 concat v2
12+ val v3a = v1 concat v2
13+ val v3b : Vec [3 ] = v3a
14+ }
You can’t perform that action at this time.
0 commit comments