| author | |
| committer | |
| log | 286077fec8f381c7b4d4d5bf351d963564a1dd69 |
| tree | 09110b434343c02573e454bb7204bdfb7d858521 |
| parent | 4918605176c2e48c178847ea281b790334207733 |
2 files changed, 8 insertions(+), 0 deletions(-)
src/stage1/ir.cpp+3| ... | @@ -19980,6 +19980,9 @@ static IrInstGen *ir_resolve_result(IrAnalyze *ira, IrInst *suspend_source_instr | ... | @@ -19980,6 +19980,9 @@ static IrInstGen *ir_resolve_result(IrAnalyze *ira, IrInst *suspend_source_instr |
| 19980 | 19980 | ||
| 19981 | result_loc = ir_analyze_struct_field_ptr(ira, suspend_source_instr, field, casted_ptr, | 19981 | result_loc = ir_analyze_struct_field_ptr(ira, suspend_source_instr, field, casted_ptr, |
| 19982 | isf->inferred_struct_type, true); | 19982 | isf->inferred_struct_type, true); |
| 19983 | if (type_is_invalid(result_loc->value->type)) { | ||
| 19984 | return result_loc; | ||
| 19985 | } | ||
| 19983 | result_loc_pass1->resolved_loc = result_loc; | 19986 | result_loc_pass1->resolved_loc = result_loc; |
| 19984 | } | 19987 | } |
| 19985 | 19988 |
test/compile_errors.zig+5| ... | @@ -2376,8 +2376,13 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { | ... | @@ -2376,8 +2376,13 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2376 | \\export fn entry() void { | 2376 | \\export fn entry() void { |
| 2377 | \\ const x = [_]u8; | 2377 | \\ const x = [_]u8; |
| 2378 | \\} | 2378 | \\} |
| 2379 | \\export fn entry2() void { | ||
| 2380 | \\ const S = struct { a: *const [_]u8 }; | ||
| 2381 | \\ var a = .{ S{} }; | ||
| 2382 | \\} | ||
| 2379 | , &[_][]const u8{ | 2383 | , &[_][]const u8{ |
| 2380 | "tmp.zig:2:15: error: inferred array size invalid here", | 2384 | "tmp.zig:2:15: error: inferred array size invalid here", |
| 2385 | "tmp.zig:5:34: error: inferred array size invalid here", | ||
| 2381 | }); | 2386 | }); |
| 2382 | 2387 | ||
| 2383 | cases.add("initializing array with struct syntax", | 2388 | cases.add("initializing array with struct syntax", |