ZIR: typeof uses the un_node field not un_tok

This commit is contained in:
Andrew Kelley 2021-05-03 18:47:53 -07:00
parent 95b014caea
commit 69d18ad7f0
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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,