4 files changed, 7 insertions(+), 3 deletions(-)
CHANGELOG.md+2| ... | ... | @@ -1,5 +1,7 @@ |
| 1 | 1 | ## 0.1.6 |
| 2 | 2 | |
| 3 | - fix: crash when printing unused struct declaration error | |
| 4 | ||
| 3 | 5 | ## 0.1.5 |
| 4 | 6 | |
| 5 | 7 | - feat: clarify "defined runtime representation" and "can be represented at runtime" |
src/core/Ast.zig+1| ... | ... | @@ -717,6 +717,7 @@ pub fn idToken(ast: Ast, node: NodeIndex) TokenIndex { |
| 717 | 717 | => ast.nodeToken(node), |
| 718 | 718 | .fn_decl, |
| 719 | 719 | .var_decl, |
| 720 | .struct_decl, | |
| 720 | 721 | => ast.nodeToken(node) + 1, |
| 721 | 722 | else => unreachable, // does not have an id |
| 722 | 723 | }; |
src/core/Report.zig+2-1| ... | ... | @@ -436,6 +436,7 @@ pub const Warn = union(enum) { |
| 436 | 436 | .param_decl => ctx.ast.fullParamDecl(data.node).id, |
| 437 | 437 | .fn_decl => ctx.ast.fullFnDecl(data.node).id, |
| 438 | 438 | .var_decl => ctx.ast.fullVarDecl(data.node).id, |
| 439 | .struct_decl => ctx.ast.fullStructDecl(data.node).id, | |
| 439 | 440 | else => unreachable, // not a valid symbol node |
| 440 | 441 | }; |
| 441 | 442 | |
| ... | ... | @@ -538,7 +539,7 @@ pub const UnusedKind = enum { |
| 538 | 539 | param, |
| 539 | 540 | constant, |
| 540 | 541 | variable, |
| 541 | function, | |
| 542 | declaration, | |
| 542 | 543 | }; |
| 543 | 544 | |
| 544 | 545 | pub const String = struct { |
src/core/Transform.zig+2-2| ... | ... | @@ -271,7 +271,7 @@ const Scope = struct { |
| 271 | 271 | try t.report.warn(.unused, .{ |
| 272 | 272 | .node = symbol.node, |
| 273 | 273 | .kind = switch (symbol.data) { |
| 274 | .declaration => .function, | |
| 274 | .declaration => .declaration, | |
| 275 | 275 | .param => .param, |
| 276 | 276 | .mutable => .variable, |
| 277 | 277 | .immutable => switch (t.ast.nodeTag(symbol.node)) { |
| ... | ... | @@ -1484,7 +1484,7 @@ fn transformAssignmentTarget( |
| 1484 | 1484 | .decl = lookup.node, |
| 1485 | 1485 | .kind = switch (lookup.data) { |
| 1486 | 1486 | .mutable => unreachable, |
| 1487 | .declaration => .function, | |
| 1487 | .declaration => .declaration, | |
| 1488 | 1488 | .param => .param, |
| 1489 | 1489 | .immutable => switch (t.ast.nodeTag(lookup.node)) { |
| 1490 | 1490 | .param_decl => .param, |