From be9f2de43a1386b3c38714bdeba68eea7167794c Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Thu, 11 Jun 2020 11:21:08 +0300 Subject: [PATCH] Fixed error union decls --- src/analysis.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/analysis.zig b/src/analysis.zig index b6567f1..4151815 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -165,6 +165,10 @@ pub fn getDeclNameToken(tree: *ast.Tree, node: *ast.Node) ?ast.TokenIndex { const field = node.cast(ast.Node.ContainerField).?; return field.name_token; }, + .ErrorTag => { + const tag = node.cast(ast.Node.ErrorTag).?; + return tag.name_token; + }, // We need identifier for captures and error set tags .Identifier => { const ident = node.cast(ast.Node.Identifier).?; @@ -1291,7 +1295,7 @@ fn makeScopeInternal( .tests = &[0]*ast.Node{}, .data = .{ .container = node }, }; - var scope_idx = scopes.items.len - 1; + const scope_idx = scopes.items.len - 1; var uses = std.ArrayList(*ast.Node.Use).init(allocator); var tests = std.ArrayList(*ast.Node).init(allocator);