@@ -3524,50 +3524,57 @@ open class KotlinFileExtractor(
3524
3524
}
3525
3525
is IrConst <* > -> {
3526
3526
val exprParent = parent.expr(e, callable)
3527
- when (val v = e.value) {
3528
- is Int , is Short , is Byte -> {
3529
- extractConstantInteger(v as Number , tw.getLocation(e), exprParent.parent, exprParent.idx, callable, exprParent.enclosingStmt)
3530
- } is Long -> {
3527
+ val v = e.value
3528
+ when {
3529
+ v is Number && (v is Int || v is Short || v is Byte ) -> {
3530
+ extractConstantInteger(v, tw.getLocation(e), exprParent.parent, exprParent.idx, callable, exprParent.enclosingStmt)
3531
+ }
3532
+ v is Long -> {
3531
3533
val id = tw.getFreshIdLabel<DbLongliteral >()
3532
3534
val type = useType(e.type)
3533
3535
val locId = tw.getLocation(e)
3534
3536
tw.writeExprs_longliteral(id, type.javaResult.id, exprParent.parent, exprParent.idx)
3535
3537
tw.writeExprsKotlinType(id, type.kotlinResult.id)
3536
3538
extractExprContext(id, locId, callable, exprParent.enclosingStmt)
3537
3539
tw.writeNamestrings(v.toString(), v.toString(), id)
3538
- } is Float -> {
3540
+ }
3541
+ v is Float -> {
3539
3542
val id = tw.getFreshIdLabel<DbFloatingpointliteral >()
3540
3543
val type = useType(e.type)
3541
3544
val locId = tw.getLocation(e)
3542
3545
tw.writeExprs_floatingpointliteral(id, type.javaResult.id, exprParent.parent, exprParent.idx)
3543
3546
tw.writeExprsKotlinType(id, type.kotlinResult.id)
3544
3547
extractExprContext(id, locId, callable, exprParent.enclosingStmt)
3545
3548
tw.writeNamestrings(v.toString(), v.toString(), id)
3546
- } is Double -> {
3549
+ }
3550
+ v is Double -> {
3547
3551
val id = tw.getFreshIdLabel<DbDoubleliteral >()
3548
3552
val type = useType(e.type)
3549
3553
val locId = tw.getLocation(e)
3550
3554
tw.writeExprs_doubleliteral(id, type.javaResult.id, exprParent.parent, exprParent.idx)
3551
3555
tw.writeExprsKotlinType(id, type.kotlinResult.id)
3552
3556
extractExprContext(id, locId, callable, exprParent.enclosingStmt)
3553
3557
tw.writeNamestrings(v.toString(), v.toString(), id)
3554
- } is Boolean -> {
3558
+ }
3559
+ v is Boolean -> {
3555
3560
val id = tw.getFreshIdLabel<DbBooleanliteral >()
3556
3561
val type = useType(e.type)
3557
3562
val locId = tw.getLocation(e)
3558
3563
tw.writeExprs_booleanliteral(id, type.javaResult.id, exprParent.parent, exprParent.idx)
3559
3564
tw.writeExprsKotlinType(id, type.kotlinResult.id)
3560
3565
extractExprContext(id, locId, callable, exprParent.enclosingStmt)
3561
3566
tw.writeNamestrings(v.toString(), v.toString(), id)
3562
- } is Char -> {
3567
+ }
3568
+ v is Char -> {
3563
3569
val id = tw.getFreshIdLabel<DbCharacterliteral >()
3564
3570
val type = useType(e.type)
3565
3571
val locId = tw.getLocation(e)
3566
3572
tw.writeExprs_characterliteral(id, type.javaResult.id, exprParent.parent, exprParent.idx)
3567
3573
tw.writeExprsKotlinType(id, type.kotlinResult.id)
3568
3574
extractExprContext(id, locId, callable, exprParent.enclosingStmt)
3569
3575
tw.writeNamestrings(v.toString(), v.toString(), id)
3570
- } is String -> {
3576
+ }
3577
+ v is String -> {
3571
3578
val id = tw.getFreshIdLabel<DbStringliteral >()
3572
3579
val type = useType(e.type)
3573
3580
val locId = tw.getLocation(e)
@@ -3576,7 +3583,7 @@ open class KotlinFileExtractor(
3576
3583
extractExprContext(id, locId, callable, exprParent.enclosingStmt)
3577
3584
tw.writeNamestrings(v.toString(), v.toString(), id)
3578
3585
}
3579
- null -> {
3586
+ v == null -> {
3580
3587
val id = tw.getFreshIdLabel<DbNullliteral >()
3581
3588
val type = useType(e.type) // class;kotlin.Nothing
3582
3589
val locId = tw.getLocation(e)
0 commit comments