Kirill Borichevskiy
07/02/2023, 5:54 AM0.toInt()
Came down to the annotation class IntrinsicConstEvaluation
, the docs say it's to run compiler optimization. Maybe someone can tell me why to explicitly cast 0 to Int?
@Ivan KylchikIvan Kylchik
07/02/2023, 9:14 AMsumOf
versions. So I think the answer is that it is just easier this way. We can just write <http://0.to|0.to>$typeShortName()
and avoid big when
where we select the exact literal. As you said, this code will be optimized at compile time, so there will not be overhead on runtime (at least for the case with primitives).Kirill Borichevskiy
07/02/2023, 1:17 PM