authorgravatar for me@paperdave.netdave caruso <me@paperdave.net> 2024-07-27 05:45:08-07:00
committergravatar for me@paperdave.netdave caruso <me@paperdave.net> 2024-07-27 05:46:14-07:00
log28d59decc157620157d0c1678600670becf50c73
tree863522dbc1b108329dfe4517db442355e63dc9d7
parent0db34290459c0011db8da43908d0b5fda7b38ad3
signature Commit is signed but in an unrecognized format.

fix: provide array result type to sema


3 files changed, 3 insertions(+), 2 deletions(-)

CHANGELOG.md+1
...@@ -1,6 +1,7 @@...@@ -1,6 +1,7 @@
1## 0.1.61## 0.1.6
22
3- fix: crash when printing unused struct declaration error3- fix: crash when printing unused struct declaration error
4- fix: provide array result type to sema
45
5## 0.1.56## 0.1.5
67
src/core/Sema.zig+1-1
...@@ -875,7 +875,7 @@ fn analyzeCodeInner(s: *Sema, in: Teg.Inst.Index) Error!Air.Inst.Ref {...@@ -875,7 +875,7 @@ fn analyzeCodeInner(s: *Sema, in: Teg.Inst.Index) Error!Air.Inst.Ref {
875 .array_init => {875 .array_init => {
876 const node: Teg.ArrayInit = s.code.instPayload(.array_init, in);876 const node: Teg.ArrayInit = s.code.instPayload(.array_init, in);
877877
878 assert(node.list.len > 0);878 assert(node.list.len > 0 or node.type_hint.unwrap() != null);
879879
880 const scratch = try s.scratch.reserve(s.arena, Air.Inst.Ref, node.list.len);880 const scratch = try s.scratch.reserve(s.arena, Air.Inst.Ref, node.list.len);
881 defer scratch.deinit();881 defer scratch.deinit();
src/core/Transform.zig+1-1
...@@ -1394,7 +1394,7 @@ fn transformExpression(...@@ -1394,7 +1394,7 @@ fn transformExpression(
1394 return try t.addRef(.array_init, .{1394 return try t.addRef(.array_init, .{
1395 .src_node = ctx.nodeOffset(node),1395 .src_node = ctx.nodeOffset(node),
1396 .extra_index = try t.extra.append(t.gpa, Teg.ArrayInit, .{1396 .extra_index = try t.extra.append(t.gpa, Teg.ArrayInit, .{
1397 .type_hint = .none,1397 .type_hint = if (array_type) |ty| ty.toOptional() else .none,
1398 .list = items,1398 .list = items,
1399 }),1399 }),
1400 });1400 });