Warning for integer overflow
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
// val prop1: null
|
||||
val prop1 = 1 / 0
|
||||
|
||||
// val prop2: null
|
||||
val prop2 = 1 / 0.0
|
||||
|
||||
// val prop3: null
|
||||
val prop3 = 1.0 / 0
|
||||
|
||||
// val prop4: 10.0.toDouble()
|
||||
val prop4 = 1 / 0.1
|
||||
|
||||
// val prop5: null
|
||||
val prop5 = 1 / 0.toLong()
|
||||
@@ -1,19 +1,19 @@
|
||||
package test
|
||||
|
||||
// _ prop1: 513105426295.toLong()
|
||||
// val prop1: 513105426295.toLong()
|
||||
val prop1: Int = 0x7777777777
|
||||
|
||||
// _ prop2: 513105426295.toLong()
|
||||
// val prop2: 513105426295.toLong()
|
||||
val prop2: Long = 0x7777777777
|
||||
|
||||
// _ prop3: 513105426295.toLong()
|
||||
// val prop3: 513105426295.toLong()
|
||||
val prop3 = 0x7777777777
|
||||
|
||||
// _ prop4: -2147483648.toInt()
|
||||
// val prop4: -2147483648.toInt()
|
||||
val prop4: Int = Integer.MAX_VALUE + 1
|
||||
|
||||
// _ prop5: -2147483648.toLong()
|
||||
// val prop5: -2147483648.toLong()
|
||||
val prop5: Long = Integer.MAX_VALUE + 1
|
||||
|
||||
// _ prop6: -2147483648.toInt()
|
||||
// val prop6: -2147483648.toInt()
|
||||
val prop6 = Integer.MAX_VALUE + 1
|
||||
|
||||
Reference in New Issue
Block a user