Is this supposed to not work? (I'm using JVM IR) `...
# announcements
d
Is this supposed to not work? (I'm using JVM IR)
Copy code
val myNum: Int = 5
val myBigNum: Long = myNum // fine
val myMaybeBigNum: Long? = myNum // not fine
c
for me
Copy code
val myBigNum: Long = myNum
also gives an error because kotlin does not automatically convert int to long
d
Ah, just tried it again and you're right. Odd.
a
It's by design.
Note that unlike some other languages, there are no implicit widening conversions for numbers in Kotlin.
d
That I know, I was just momentarily confused by the nullable discrepancy.