Consider code example:
val contentLength :Long? = 1
val float = contentLength?.toFloat()
val any = (float ?: 0) * 1.25
// ^
// compilation error here
If I try to extract variable herem like that:
val casted = (float ?: 0)
IDE shows that casted has Any as type. Why it happens? How to get nullsafe float value from float reference and multiply it to another float value?
UPDATED
Replacing 0 with 0.0:
(float ?: 0.0)
has no effect. :(