Fix reflect crash on modules using glob imports (#1816)
This excludes glob imports when creating a module's mirror
This commit is contained in:
1 parent
ae9160df51
commit
a90eb74c2d
4 files changed
+23
-2
No files matched your search
@@ -115,7 +115,11 @@ public final class VmTyped extends VmObject {
|
||||
if (bodyNode instanceof WrapperNode wrapper) {
|
||||
bodyNode = (ExpressionNode) wrapper.getDelegateNode();
|
||||
}
|
||||
builder.add(member.getName().toString(), ((ImportNode) bodyNode).getImportUri().toString());
|
||||
// Glob imports (`import*`) don't import a type; they resolve to a mapping.
|
||||
// Exclude them here, consistent with `imports` also not covering import expressions.
|
||||
if (bodyNode instanceof ImportNode importNode) {
|
||||
builder.add(member.getName().toString(), importNode.getImportUri().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
return builder.build();
|
||||
|
||||
Reference in new issue
Block a user