Am I doing something wrong?
I defined a var in the constructor. The var is used by the parent constructor. I can use the value. But when I try to update it, it says val can't be reassigned.. but it isn't a val
t
tseisel
12/29/2019, 3:12 PM
This is because you are writing a lambda that is passed to the superclass constructor, in the constructor of your class.
In this context, the compiler thinks you are referring to the constructor param named
currentState
and not the property of the same name.
If you want to reference the property, apply the "Assign to property" suggestion of the IDE to introduce