Hello, everyone! :blush: Is there a reason to the...
# announcements
e
Hello, everyone! 😊 Is there a reason to the following code give me a Java warning? I made it nullable because this is a non-required foreign key.
Copy code
internal inline class CategoryId(val value: Long?)
Copy code
fun test(){
    CategoryId(12)
}
Warning:
Use Long.valueOf(12) instead
m
Try
12L
e
Same warning.
a
Can’t reproduce here.
e
Weird… Maybe some config on my side. I tried on Kotlin 1.4.30. Even weirder is if I try to set null:
Use Long.valueOf(null) instead
a
Copy code
Kotlin: kotlinc-jvm 1.4.30 (JRE 11.0.5+10-LTS)
Kotlin: The feature "inline classes" is experimental
Warning about
inline
, but nothing about
Long
. Must be somewhere else.
a
at least with 1.4.30, the kotlinc-jvm output will emit a
Long.valueOf(12)
call rather than
new Long(12)
(which is what that warning sounds to be about), so I don’t see where it’s coming from (tbh I can’t even tell what tool it’s coming from)