mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
parent
4e9ab0306a
commit
71e209521a
@ -20405,6 +20405,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInstruction *source_instr
|
||||
bigint_init_unsigned(&inner_fields[2].data.x_union.tag, 1);
|
||||
|
||||
ConstExprValue *payload = create_const_vals(1);
|
||||
payload->special = ConstValSpecialStatic;
|
||||
payload->type = ira->codegen->builtin_types.entry_type;
|
||||
payload->data.x_type = var->const_value->type;
|
||||
|
||||
@ -20525,6 +20526,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInstruction *source_instr
|
||||
bigint_init_unsigned(&inner_fields[2].data.x_union.tag, 0);
|
||||
|
||||
ConstExprValue *payload = create_const_vals(1);
|
||||
payload->special = ConstValSpecialStatic;
|
||||
payload->type = ira->codegen->builtin_types.entry_type;
|
||||
payload->data.x_type = type_entry;
|
||||
|
||||
|
||||
@ -339,3 +339,10 @@ test "type info: extern fns with and without lib names" {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test "data field is a compile-time value" {
|
||||
const S = struct {
|
||||
const Bar = isize(-1);
|
||||
};
|
||||
comptime expect(@typeInfo(S).Struct.decls[0].data.Var == isize);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user