Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Invalid assignment through a property

Properties can only be assigned as a whole, not through member or index access.

A setter position is conceptually just a method call, similar to:

instance.set_position(value)

That means the setter updates the entire property value. It does not produce an assignable intermediate value, so writing through a property into nested fields or elements is not allowed.

Invalid

Assigning to a field of a property:

instance.position.x := 5;

Assigning to an indexed element of a property:

instance.values[1] := 5;

Using a property as the base of a larger assignment target:

instance.positions[1].x := 5;

Valid

Assign the full property value:

instance.position := value;
instance.values := local_array;

Read from a property and then access members or indices:

local := instance.position.x;
arr[instance.position.x] := 5;