Skip to content

Commit d0ba664

Browse files
mateusz834andrewrk
authored andcommitted
std.Zig.AstGen: handle properly .inferred_ptr and .destructure in enum_literal handling
rl.resultType() returns null for inferred_ptr and destructure, so move that to the unreachable block.
1 parent 14ba3bd commit d0ba664

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/std/zig/AstGen.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,9 +1006,9 @@ fn expr(gz: *GenZir, scope: *Scope, ri: ResultInfo, node: Ast.Node.Index) InnerE
10061006
.field_name_start = str_index,
10071007
});
10081008
switch (ri.rl) {
1009-
.discard, .none, .ref => unreachable, // no result type
1009+
.discard, .none, .ref, .inferred_ptr, .destructure => unreachable, // no result type
10101010
.ty, .coerced_ty => return res, // `decl_literal` does the coercion for us
1011-
.ref_coerced_ty, .ptr, .inferred_ptr, .destructure => return rvalue(gz, ri, res, node),
1011+
.ref_coerced_ty, .ptr => return rvalue(gz, ri, res, node),
10121012
}
10131013
} else return simpleStrTok(gz, ri, tree.nodeMainToken(node), node, .enum_literal),
10141014
.error_value => return simpleStrTok(gz, ri, tree.nodeMainToken(node) + 2, node, .error_value),

0 commit comments

Comments
 (0)