Join Slack
Powered by
I have a code like this: <https://pl.kotl.in/5vZUg...
# announcements
k
koral
03/23/2020, 9:17 PM
I have a code like this:
https://pl.kotl.in/5vZUgXStV
I expect that it will print
true
. However,
ClassCastException: java.lang.Long cannot be cast to DogId
is thrown. Is it a bug in kotlin? Or maybe I’m using inline classes incorrectly?
j
Jakub Pi
03/23/2020, 9:40 PM
Known issue:
https://youtrack.jetbrains.com/issue/KT-30716
More information here:
https://youtrack.jetbrains.com/issue/KT-30419
🙏 1
Jakub Pi
03/23/2020, 9:42 PM
Unless you really need it, just use a data class and trust the compiler to optimise it out. You can always come back to it if your benchmarks show it is on the hotpath
➕ 1
👍 1
2
Views
Open in Slack
Previous
Next