Keep old scope nodes onContainer

This commit is contained in:
Alexandros Naskos 2020-05-24 19:26:46 +03:00
parent 075c364767
commit d6513456c1

View File

@ -273,7 +273,7 @@ pub const AnalysisContext = struct {
if (self.in_container != &container.base) {
self.in_container = &container.base;
var scope_nodes = std.ArrayList(*std.zig.ast.Node).init(&self.arena.allocator);
var scope_nodes = std.ArrayList(*std.zig.ast.Node).fromOwnedSlice(&self.arena.allocator, self.scope_nodes);
try analysis.addChildrenNodes(&scope_nodes, self.tree(), &container.base);
self.scope_nodes = scope_nodes.items;
}