ID:1761463
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Take this code for example:
/proc/testing()
world.xyzzy = 99
world.loop_checks = 42
return

The second line throws a compile error since xyzzy is not defined, but the third line will only error at runtime.

Considering the compiler knows about const-ness in some way, and already checks all var accesses with "." to make sure they're defined, would it be feasible to check if they're consts there as well?
loop_checks isn't const; it's simply compile-time only.
Alright. In that case it might be an even better example of something that could be checked for legality at compile-time, instead of at runtime.
Honestly, I think this kind of check would only burden the compiler. Maybe as an option it could be useful, if you wanted to be absolutely sure everything was legit, but otherwise big projects would just take a lot longer to compile.
Yeah, agreed there. A --strict or whatever option with more checks like this could be useful, especially for smaller projects and travis builds.
Even as an option this would slow down the compiler when it's not used; the if statement needed to check on it would always have to run, if nothing else.