You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#12 0x0000555555640b3f in ir_assert (ok=false, source_instruction=0x555555dabbb0) at zig/src/ir.cpp:9225
#13 0x0000555555652d18 in ir_analyze_cast (ira=0x555555da9ca0, source_instr=0x555555dabbb0, wanted_type=0x555555daa4b0, value=0x555555dabbb0) at zig/src/ir.cpp:13941
#14 0x00005555556531ef in ir_implicit_cast2 (ira=0x555555da9ca0, value_source_instr=0x555555dabbb0, value=0x555555dabbb0, expected_type=0x555555daa4b0)
at zig/src/ir.cpp:14003
#15 0x000055555565321e in ir_implicit_cast (ira=0x555555da9ca0, value=0x555555dabbb0, expected_type=0x555555daa4b0) at zig/src/ir.cpp:14007
#16 0x0000555555661689 in ir_analyze_store_ptr (ira=0x555555da9ca0, source_instr=0x555555ba8b30, ptr=0x555555ba6ce0, uncasted_value=0x555555dabbb0, allow_write_through_const=false)
at zig/src/ir.cpp:17922
#17 0x00005555556893df in ir_analyze_instruction_end_expr (ira=0x555555da9ca0, instruction=0x555555ba8b30) at zig/src/ir.cpp:28115
#18 0x000055555568ad9e in ir_analyze_instruction_base (ira=0x555555da9ca0, instruction=0x555555ba8b30) at zig/src/ir.cpp:28665
#19 0x000055555568b28d in ir_analyze (codegen=0x555555a10b20, old_exec=0x555555ac3420, new_exec=0x555555ac3260, expected_type=0x555555aa96a0, expected_type_source_node=0x0)
at zig/src/ir.cpp:28750
#20 0x00005555556e02d9 in analyze_fn_ir (g=0x555555a10b20, fn=0x555555ac31e0, return_type_node=0x0) at zig/src/analyze.cpp:4648
#21 0x00005555556e08a6 in analyze_fn_body (g=0x555555a10b20, fn_table_entry=0x555555ac31e0) at zig/src/analyze.cpp:4756
#22 0x00005555556e113f in semantic_analyze (g=0x555555a10b20) at zig/src/analyze.cpp:4868
#23 0x000055555560c2f5 in gen_root_source (g=0x555555a10b20) at zig/src/codegen.cpp:9308
#24 0x0000555555610108 in codegen_build_and_link (g=0x555555a10b20) at zig/src/codegen.cpp:10313
#25 0x00005555555e343d in main (argc=3, argv=0x7fffffffbec8) at zig/src/main.cpp:1351
The text was updated successfully, but these errors were encountered:
daurnimator
added
bug
Observed behavior contradicts documented or intended behavior
stage1
The process of building from source via WebAssembly and the C backend.
labels
Dec 24, 2019
Ran into this in 0.5.0+b55bc5e in #4417 . When this is fixed it might be worth testing to make sure the below works as well:
constStructWithDefault=struct {
value: f32=42,
};
constSomeStruct=struct {
array: [4]StructWithDefault,
};
pubfnmain() void {
// Ok #1: Array element type inferredconstvalue0=SomeStruct{ .array= [_]StructWithDefault{.{}} ++ [_]StructWithDefault{undefined} **3 };
// Ok #2: Array type inferred from defined elementsconstvalue1=SomeStruct{ .array= .{ StructWithDefault{}, StructWithDefault{}, StructWithDefault{}, StructWithDefault{} } };
// Ok #3: Array type and element type inferredconstvalue2=SomeStruct{ .array= .{ .{}, .{}, .{}, .{} } };
// error #1: error: expected array, found 'struct:14:4'2 (Define element type, remove array type definition)constvalue3=SomeStruct{ .array= .{StructWithDefault{}} ++ [_]StructWithDefault{undefined} **3 };
// error #2: error: expected array, found 'struct:16:42' (Remove element type and array type in first arg)constvalue4=SomeStruct{ .array= .{.{}} ++ [_]StructWithDefault{undefined} **3 };
// error #3: error: expected array, found 'struct:18:52' (Remove element type and array type in both args)constvalue5=SomeStruct{ .array= .{.{}} ++ .{undefined} **3 };
// error #4: assertion failed. This is a bug in the Zig compiler.constvalue6=SomeStruct{ .array= .{ .{}, .{}, } ++ .{.{}, .{} }} ;
}
The text was updated successfully, but these errors were encountered: