-
Notifications
You must be signed in to change notification settings - Fork 75
Description
Summary
The only way I can see to add the global part of a global import is ModuleGlobals::add_import
. This requires an ImportId
for the import part of the global import. The only way I can see to get that is by using ModuleImports::add
, but that requires an ImportKind
enum, which for the global variant requires... a GlobalId
, which we need to call ModuleGlobals::add_import
to get... and we're back where we started.
Additional Details
Perhaps one potential way to do this would be to call ModuleGlobals::add_local
with dummy values to reserve a GlobalId
, then mutate that later? But that feels like quite an ugly workaround.
Am I missing some easy way of doing this? If not, should there perhaps be a utility function that can allocate to both arenas at once so this is possible?