https://kotlinlang.org logo
Title
f

Florian

10/04/2019, 7:43 PM
I was under the impression that
const val
can not be assigned any function calls, but as I found out from this SO question it's actually possible for some functions: https://stackoverflow.com/questions/44921746/what-can-be-expressed-in-a-compile-time-constant-const-val From the given answers, it's not completely clear to me what is the reason for that. Is it because these function calls are not actually translated to function calls by the compiler, but replaced for operators?
k

karelpeeters

10/04/2019, 11:19 PM
This is a common trend in language design, at first there are a couple of special cases, after a couple of years you can write your own `const fun`s. Give it some time 😒imple_smile:
f

Florian

10/05/2019, 7:10 AM
but right now it seems there is a common denominator