KT-40359 Catch NumberFormatException during literal conversion

- Instead of failing J2K conversion completely, insert TODO expression
to the resulting code (it is better to have a converted code with TODO
than to have nothing at all)
- See EA-210233 for similar exceptions
- ^KT-40359 Fixed
This commit is contained in:
Roman Golyshev
2020-07-20 14:46:14 +03:00
committed by Roman Golyshev
parent cc0a787735
commit cba671a3ef
3 changed files with 29 additions and 4 deletions
+4
View File
@@ -1,8 +1,12 @@
class Test {
int negativeOctalInt = 023432423432;
int octalInt = 07432423432;
int invalidOctalInt = 08;
long negativeOctalLong = 01777777777777777777777L;
long octalLong = 0777777777777777777777L;
long invalidOctalLong = 08L;
short octalShort = 047777;
byte octalByte = 077;
}
+2
View File
@@ -1,8 +1,10 @@
internal class Test {
var negativeOctalInt = -1670764774
var octalInt = 1013589786
var invalidOctalInt: Int = TODO("Could not convert int literal '08' to Kotlin")
var negativeOctalLong = -1L
var octalLong = 9223372036854775807L
var invalidOctalLong: Long = TODO("Could not convert long literal '08L' to Kotlin")
var octalShort: Short = 20479
var octalByte: Byte = 63
}