Fixed field access

This commit is contained in:
Alexandros Naskos
2020-06-11 00:24:57 +03:00
parent 86e417e8dc
commit b8b6c534e8
2 changed files with 5 additions and 3 deletions

View File

@@ -555,6 +555,7 @@ pub fn getFieldAccessTypeNode(
store: *DocumentStore,
arena: *std.heap.ArenaAllocator,
handle: *DocumentStore.Handle,
source_index: usize,
tokenizer: *std.zig.Tokenizer,
) !?NodeWithHandle {
var current_node = NodeWithHandle{
@@ -567,7 +568,7 @@ pub fn getFieldAccessTypeNode(
switch (tok.id) {
.Eof => return try resolveFieldAccessLhsType(store, arena, current_node),
.Identifier => {
if (try lookupSymbolGlobal(store, current_node.handle, tokenizer.buffer[tok.loc.start..tok.loc.end], tok.loc.start)) |child| {
if (try lookupSymbolGlobal(store, current_node.handle, tokenizer.buffer[tok.loc.start..tok.loc.end], source_index)) |child| {
current_node = (try child.resolveType(store, arena)) orelse return null;
} else return null;
},