mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
add ability to explicitly cast enum with no payload to int
This commit is contained in:
1 parent
651dc31247
commit
6e6d138c2f
5 files changed
+44
-1
No files matched your search
@@ -1062,6 +1062,8 @@ static LLVMValueRef gen_cast_expr(CodeGen *g, AstNode *node) {
|
||||
|
||||
case CastOpIntToEnum:
|
||||
return gen_widen_or_shorten(g, node, actual_type, wanted_type->data.enumeration.tag_type, expr_val);
|
||||
case CastOpEnumToInt:
|
||||
return gen_widen_or_shorten(g, node, actual_type->data.enumeration.tag_type, wanted_type, expr_val);
|
||||
}
|
||||
zig_unreachable();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user