Fix module name tag check

This commit is contained in:
ktkk 2026-07-06 10:13:15 +00:00
parent 0cc72ac2d9
commit 0cf25ebaf4

View file

@ -1987,7 +1987,7 @@ pub const Module = struct {
try w.splatByteAll(' ', depth * requires_indent);
try w.print("{d}:\n", .{ i });
try requires.indentedFormat(w, depth, requires_indent, constant_pool);
try requires.indentedFormat(w, depth, requires_indent + 1, constant_pool);
}
try w.splatByteAll(' ', depth * indent);
@ -1999,7 +1999,7 @@ pub const Module = struct {
try w.splatByteAll(' ', depth * exports_indent);
try w.print("{d}:\n", .{ i });
try exports.indentedFormat(w, depth, exports_indent, constant_pool);
try exports.indentedFormat(w, depth, exports_indent + 1, constant_pool);
}
try w.splatByteAll(' ', depth * indent);
@ -2011,7 +2011,7 @@ pub const Module = struct {
try w.splatByteAll(' ', depth * opens_indent);
try w.print("{d}:\n", .{ i });
try opens.indentedFormat(w, depth, opens_indent, constant_pool);
try opens.indentedFormat(w, depth, opens_indent + 1, constant_pool);
}
try w.splatByteAll(' ', depth * indent);
@ -2037,12 +2037,12 @@ pub const Module = struct {
try w.splatByteAll(' ', depth * provides_indent);
try w.print("{d}:\n", .{ i });
try provides.indentedFormat(w, depth, provides_indent, constant_pool);
try provides.indentedFormat(w, depth, provides_indent + 1, constant_pool);
}
}
pub fn moduleName(self: *const Module, constant_pool: ConstantPool) ResolveError!ConstantPool.Info {
return constant_pool.getTag(self.module_name_index, .utf8);
return constant_pool.getTag(self.module_name_index, .module);
}
pub fn moduleVersion(self: *const Module, constant_pool: ConstantPool) ResolveError!?ConstantPool.Info {