authorchloe caruso <git@paperclover.net> 2024-07-27 05:51:20-07:00
committerchloe caruso <git@paperclover.net> 2024-07-27 22:15:51-07:00
log32094db88e8e631da9d39a171d589196a4d0d4d1
tree3a21296fd702e89584242347414c1b788fd45c90
parent69b6f056bfef5e63452f667d9a3a8604872f2a0b

fix: crash when analyzing an empty array without a result type


2 files changed, 5 insertions(+), 0 deletions(-)

CHANGELOG.md+1
......@@ -2,6 +2,7 @@
22
33- fix: crash when printing unused struct declaration error
44- fix: provide array result type to sema
5- fix: crash when analyzing an empty array without a result type
56
67## 0.1.5
78
src/core/Transform.zig+4
......@@ -1391,6 +1391,10 @@ fn transformExpression(
13911391 array_init.slice(&t.ast),
13921392 ) orelse return null;
13931393
1394 if (array_type == null and items.len == 0) {
1395 return .empty_array;
1396 }
1397
13941398 return try t.addRef(.array_init, .{
13951399 .src_node = ctx.nodeOffset(node),
13961400 .extra_index = try t.extra.append(t.gpa, Teg.ArrayInit, .{