File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -4162,7 +4162,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
41624162 || x.tag == LongTag && cls == defn.DoubleClass && x.longValue.toDouble.toLong != x.longValue
41634163 then
41644164 report.warning(LossyWideningConstantConversion (x.tpe, pt), tree.srcPos)
4165- return adaptConstant(tree, ConstantType (converted))
4165+ return readapt( adaptConstant(tree, ConstantType (converted) ))
41664166 case _ =>
41674167
41684168 val captured = captureWildcardsCompat(wtp, pt)
Original file line number Diff line number Diff line change 1+ @ main def main : Unit =
2+ type T = 3f
3+ val value0 : T = - 3.5f // error
4+ val value1 : T = - 100500 // error
5+ val value2 : T = - 100500L // error
6+ val value3 : T = - 100500D // error
7+ val value4 : T = true // error
8+ val value5 : 3f = - 100500 // error
9+ val value6 : 3f = - 100500L // error
You can’t perform that action at this time.
0 commit comments