authorchloe caruso <git@paperclover.net> 2024-07-27 05:45:08-07:00
committerchloe caruso <git@paperclover.net> 2024-07-27 05:46:14-07:00
log69b6f056bfef5e63452f667d9a3a8604872f2a0b
tree863522dbc1b108329dfe4517db442355e63dc9d7
parent5cf49e3076b8b164365110993b153e7d4e9989ae

fix: provide array result type to sema


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

CHANGELOG.md+1
......@@ -1,6 +1,7 @@
11## 0.1.6
22
33- fix: crash when printing unused struct declaration error
4- fix: provide array result type to sema
45
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 {
875875 .array_init => {
876876 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
880880 const scratch = try s.scratch.reserve(s.arena, Air.Inst.Ref, node.list.len);
881881 defer scratch.deinit();
src/core/Transform.zig+1-1
......@@ -1394,7 +1394,7 @@ fn transformExpression(
13941394 return try t.addRef(.array_init, .{
13951395 .src_node = ctx.nodeOffset(node),
13961396 .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,
13981398 .list = items,
13991399 }),
14001400 });