I would guess that you are making wrong assumption...
# announcements
p
I would guess that you are making wrong assumptions of the evaluation order
👌 1
j
What's weird here is that if I declare
private var collapsedMaxLines: Int = 0
everything works as expected, the value gets assigned to 5 in the method called by the super constructor and stays 5. However if I initialized the var to any non-zero value, it seems to get re-assigned to that value after the constructor method sets it to 5. In order to set the value in the constructor method - the declaration and initialization of the variable has to have already taken place - right?
o
Int
is a primitive type here, so it has zero as default value – no initialization necessary.