mirror of
https://github.com/ziglang/zig.git
synced 2026-02-15 22:09:49 +00:00
ZIR: typeof uses the un_node field not un_tok
This commit is contained in:
parent
95b014caea
commit
69d18ad7f0
@ -4614,7 +4614,7 @@ fn zirTypeInfo(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerErro
|
||||
}
|
||||
|
||||
fn zirTypeof(sema: *Sema, block: *Scope.Block, inst: Zir.Inst.Index) InnerError!*Inst {
|
||||
const inst_data = sema.code.instructions.items(.data)[inst].un_tok;
|
||||
const inst_data = sema.code.instructions.items(.data)[inst].un_node;
|
||||
const src = inst_data.src();
|
||||
const operand = try sema.resolveInst(inst_data.operand);
|
||||
return sema.mod.constType(sema.arena, src, operand.ty);
|
||||
|
||||
@ -523,7 +523,7 @@ pub const Inst = struct {
|
||||
/// Uses `un_node`.
|
||||
negate_wrap,
|
||||
/// Returns the type of a value.
|
||||
/// Uses the `un_tok` field.
|
||||
/// Uses the `un_node` field.
|
||||
typeof,
|
||||
/// Given a value which is a pointer, returns the element type.
|
||||
/// Uses the `un_node` field.
|
||||
@ -1334,7 +1334,7 @@ pub const Inst = struct {
|
||||
.subwrap = .pl_node,
|
||||
.negate = .un_node,
|
||||
.negate_wrap = .un_node,
|
||||
.typeof = .un_tok,
|
||||
.typeof = .un_node,
|
||||
.typeof_elem = .un_node,
|
||||
.typeof_log2_int_type = .un_node,
|
||||
.log2_int_type = .un_node,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user