For now, you can think of script like of a class. All properties you define in script are member properties and not top-level ones. But const properties have the following requirement:
It must be a top-level property, or a member of an object declaration or a companion object.
So, that's the reason. Const properties may become available in scripts in the future, but only after scripts redesign.
Ilya Muradyan
12/28/2021, 5:48 PM
It's also about all other things like non-inner classes with the references to the script properties or methods
h
holgerbrandl
12/28/2021, 6:51 PM
Thanks for the clarification. I guess many users will have a different mental model when thinking about a script, which is typically (in other languages) a less structured concept.
i
Ilya Muradyan
12/28/2021, 6:53 PM
Of course, it needs to be redesigned. We keep this in mind
👍 1
m
mikehearn
01/12/2022, 2:23 PM
Hmm does it? I'm using scripting OK, nothing about the design seemed wildly wrong to me. It could use some more love and development but it'd be a pity if you started again from scratch.