File tree 2 files changed +10
-1
lines changed
compiler/src/dotty/tools/dotc/typer
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
4162
4162
|| x.tag == LongTag && cls == defn.DoubleClass && x.longValue.toDouble.toLong != x.longValue
4163
4163
then
4164
4164
report.warning(LossyWideningConstantConversion (x.tpe, pt), tree.srcPos)
4165
- return adaptConstant(tree, ConstantType (converted))
4165
+ return readapt( adaptConstant(tree, ConstantType (converted) ))
4166
4166
case _ =>
4167
4167
4168
4168
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