mirror of
https://github.com/ziglang/zig.git
synced 2026-02-05 14:07:04 +00:00
autodoc: Implemented struct_init_empty for walkInstruction, fixed variable type with has_init but no type before =
This commit is contained in:
parent
f68d3c63df
commit
76fcb95bdf
@ -2200,17 +2200,10 @@ fn walkInstruction(
|
||||
false,
|
||||
);
|
||||
|
||||
_ = operand;
|
||||
|
||||
// WIP
|
||||
|
||||
printWithContext(
|
||||
file,
|
||||
inst_index,
|
||||
"TODO: implement `{s}` for walkInstruction\n\n",
|
||||
.{@tagName(tags[inst_index])},
|
||||
);
|
||||
return self.cteTodo(@tagName(tags[inst_index]));
|
||||
return DocData.WalkResult{
|
||||
.typeRef = operand.expr,
|
||||
.expr = .{ .@"struct" = &.{} },
|
||||
};
|
||||
},
|
||||
.struct_init_anon => {
|
||||
const pl_node = data[inst_index].pl_node;
|
||||
@ -2537,6 +2530,7 @@ fn walkInstruction(
|
||||
const var_init_ref = @intToEnum(Ref, file.zir.extra[extra_index]);
|
||||
const var_init = try self.walkRef(file, parent_scope, parent_src, var_init_ref, need_type);
|
||||
value.expr = var_init.expr;
|
||||
value.typeRef = var_init.typeRef;
|
||||
}
|
||||
|
||||
return value;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user