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 {
459459 if (idx >= 0 ) selfRecName(idx + 1 )
460460 else " {...}.this" // TODO move underlying type to an addendum, e.g. ... z3 ... where z3: ...
461461 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+ toText(tp.repr)
465469 }
466470 }
467471
Original file line number Diff line number Diff line change @@ -2245,8 +2245,9 @@ class Namer { typer: Typer =>
22452245 // it would be erased to BoxedUnit.
22462246 def dealiasIfUnit (tp : Type ) = if (tp.isRef(defn.UnitClass )) defn.UnitType else tp
22472247
2248- def cookedRhsType = dealiasIfUnit(rhsType).deskolemized
2248+ def cookedRhsType = dealiasIfUnit(rhsType)
22492249 def lhsType = fullyDefinedType(cookedRhsType, " right-hand side" , mdef.srcPos)
2250+ .deskolemized
22502251 // if (sym.name.toString == "y") println(i"rhs = $rhsType, cooked = $cookedRhsType")
22512252 if (inherited.exists)
22522253 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