From f58fdcb80e2b5436d54ec634b6e44abcd497db3f Mon Sep 17 00:00:00 2001 From: Daniel Gavin Date: Fri, 10 Sep 2021 22:43:16 +0200 Subject: check only the builtin on the source package --- src/analysis/analysis.odin | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/analysis') diff --git a/src/analysis/analysis.odin b/src/analysis/analysis.odin index a367f1a..0806a4c 100644 --- a/src/analysis/analysis.odin +++ b/src/analysis/analysis.odin @@ -1180,11 +1180,19 @@ resolve_type_identifier :: proc(ast_context: ^AstContext, node: ast.Ident) -> (i } //last option is to check the index - if symbol, ok := index.lookup(node.name, ast_context.current_package); ok { return resolve_symbol_return(ast_context, symbol); } + //If we are resolving a symbol that is in the document package, then we'll check the builtin packages. + if ast_context.current_package == ast_context.document_package { + for built in index.indexer.built_in_packages { + if symbol, ok := index.lookup(node.name, built); ok { + return resolve_symbol_return(ast_context, symbol); + } + } + } + for u in ast_context.usings { //TODO(Daniel, make into a map, not really required for performance but looks nicer) -- cgit v1.2.3