This is related to #217, where we can add declarations for expected variable attributes in an effort to generalize that mechanism and remove hardcoded adhoc behavior.
This is currently difficult due to interfacing issues with the current codebase. But it should be kept in mind when we reappropriate this part of the code.