Type And Reference

no-email (Damien Seguy), Damien Seguy
Tue, 27 May 2025 00:00:00 +0000

Parameter's type is check at calling time. Later, the type of the argument is not enforced anymore, and the argument behaves like a local variable: its type may change.
When typing a parameter and passing it by reference, the type is checked at call time, and then, never checked again. This means the variable may change its type, and, by consequence, the original value may also end up with a different type than expected.
If you want persistent typing, use a property: its type is checked at every step of its life.