Open
Description
In ModuleResolver.createAdaptedModule
, modules that are not resources are assigned a type after running the module (with moduleType = v.getType();
). This gets the metadata into the type. But the type arises from run-time execution and might not be well-formed in the surrounding context.
The right way to do this is to run the module, get the type from the run time, and then copy just the metadata into a type that is well-formed in the current context.
This (latent) bug can be triggered by EffectSystemTests.testNetwork18
if you comment out newES = new EffectSet(newS);
in DefDeclType
. It can probably be triggered directly too, but I don't have an example.