Carpet

Carpet

2M Downloads

Variables `_`, `_i`, `_a`, `_x`, `_y` and `_z` are not assignable inside functions

altrisi opened this issue ยท 1 comments

commented

This is because they're all initialized to Value.ZERO in context initialization, and Value.ZERO is not bound to any variable. Due to how variable recognizing currently works, they're therefore not assignable.

This should be fixed with my bound variable refactor, though idrk why are these initialized on context init or if they should just be undefined. Especially since they've been failing to work, so it's likely no one has been using them.

This also only happens inside functions because it seems like Context.initialize isn't called outside.

Repro example:

a() -> _i = 2; a()
commented

These will get assignable with the boundVariable removal, but then it should be a good idea to remove their explicit initialization (would improve perf of every function call).