Open CheezusChrust opened 5 months ago
Oh god are you the same cheeze that made the horribly uncompressed button textures?
This is intentional since @strict
doesn't replace globals every time now, but I think it really should initialize on the first go, at least, since that wouldn't cost much.
That or make the compiler not stupid and include the scoping when deciding if a variable has already been assigned to. I'd prefer that.
ie https://github.com/wiremod/wire/blob/4038ae0a5cd2335d6af52d6baafb6fbc70d74e21/lua/entities/gmod_wire_expression2/base/compiler.lua#L1023 should also write down the scopeid
it was initialized at (careful to only assign if currentid < assignid
), then just check if assignid < currentid
when checking if the variable is initialized or not.
Then you'll at least get a warning in advance.
Describe the bug
sv: Expression 2 (oops): Internal error 'entities/gmod_wire_expression2/core/number.lua:81: attempt to perform arithmetic on local 'lhs' (a nil value)' at line 8, char 1
To Reproduce
Expected behavior A compiler error or something