File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -459,9 +459,13 @@ class PlainPrinter(_ctx: Context) extends Printer {
459
459
if (idx >= 0 ) selfRecName(idx + 1 )
460
460
else " {...}.this" // TODO move underlying type to an addendum, e.g. ... z3 ... where z3: ...
461
461
case tp : SkolemType =>
462
- if (homogenizedView) toText(tp.info)
463
- else if (ctx.settings.XprintTypes .value) " <" ~ toText(tp.repr) ~ " :" ~ toText(tp.info) ~ " >"
464
- else toText(tp.repr)
462
+ def reprStr = toText(tp.repr) ~ hashStr(tp)
463
+ if homogenizedView then
464
+ toText(tp.info)
465
+ else if ctx.settings.XprintTypes .value then
466
+ " <" ~ reprStr ~ " :" ~ toText(tp.info) ~ " >"
467
+ else
468
+ reprStr
465
469
}
466
470
}
467
471
Original file line number Diff line number Diff line change @@ -2245,8 +2245,9 @@ class Namer { typer: Typer =>
2245
2245
// it would be erased to BoxedUnit.
2246
2246
def dealiasIfUnit (tp : Type ) = if (tp.isRef(defn.UnitClass )) defn.UnitType else tp
2247
2247
2248
- def cookedRhsType = dealiasIfUnit(rhsType).deskolemized
2248
+ def cookedRhsType = dealiasIfUnit(rhsType)
2249
2249
def lhsType = fullyDefinedType(cookedRhsType, " right-hand side" , mdef.srcPos)
2250
+ .deskolemized
2250
2251
// if (sym.name.toString == "y") println(i"rhs = $rhsType, cooked = $cookedRhsType")
2251
2252
if (inherited.exists)
2252
2253
if sym.isInlineVal || isTracked then lhsType else inherited
Original file line number Diff line number Diff line change
1
+ import scala .language .experimental .modularity
2
+
3
+ class Box1 [T <: Singleton ](val x : T )
4
+ class Box2 [T : Singleton ](x : => T )
5
+ def id (x : Int ): x.type = x
6
+ def readInt (): Int = ???
7
+
8
+ def Test = ()
9
+ val x = Box1 (id(readInt()))
10
+
11
+ val _: Box1 [? <: Int ] = x
12
+
13
+ val y = Box2 (id(readInt())) // error
You can’t perform that action at this time.
0 commit comments