OpenDream icon indicating copy to clipboard operation
OpenDream copied to clipboard

Fixes statics not allowing calls to late-defined procs

Open Altoids1 opened this issue 3 years ago • 0 comments

Fixes #869.

Summary

At first I thought that this would be arduous to set up, with the need for events or whatever, but it turns out that all that was needed was some short-circuiting during Object variable instantiation. :)

To elaborate a little, the superduper proc that instantiates all statics at runtime boot is only generated at the very end of DMObjectBuilder, after even DMProcBuilder has done its own work. So there was no real need to change any ordering, since by that point, all static declarations are already scanned.

This means that we can just, defer evaluating the static declaration's righthand-side until that point, no biggie. This is really just like, a five-line change; there's more diff than that here because I added a test, more comments, and did some minor code reorganization, in my usual style :^)

Changelog

  • Fixed statics not permitting assignment via a proc whose definition has yet to be found.

Altoids1 avatar Oct 26 '22 03:10 Altoids1