You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Summary
The only way I can see to add the global part of a global import is
ModuleGlobals::add_import
. This requires anImportId
for the import part of the global import. The only way I can see to get that is by usingModuleImports::add
, but that requires anImportKind
enum, which for the global variant requires... aGlobalId
, which we need to callModuleGlobals::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 aGlobalId
, 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?
The text was updated successfully, but these errors were encountered: