diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2021-09-10 22:43:16 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2021-09-10 22:43:16 +0200 |
| commit | f58fdcb80e2b5436d54ec634b6e44abcd497db3f (patch) | |
| tree | ad995886e4e1530d5fb62c89a555f902fc35e07e /src/analysis | |
| parent | 42858ae86d8c72028c922eccdffa492e117da231 (diff) | |
check only the builtin on the source package
Diffstat (limited to 'src/analysis')
| -rw-r--r-- | src/analysis/analysis.odin | 10 |
1 files changed, 9 insertions, 1 deletions
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) |