diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2021-10-14 00:38:47 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2021-10-14 00:38:47 +0200 |
| commit | 6a6da413d5adbb0bdb39eb11951e173adc42d14f (patch) | |
| tree | 91975e6a738f8bbb6f1a8ce0b8eb147828d004e0 /src | |
| parent | 893540ee2e9573720ab379deaa4d595926abefe3 (diff) | |
Fix bug where context.* was not resolved correctly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/analysis/analysis.odin | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/analysis/analysis.odin b/src/analysis/analysis.odin index 045e06f..ec42378 100644 --- a/src/analysis/analysis.odin +++ b/src/analysis/analysis.odin @@ -1125,7 +1125,11 @@ resolve_type_identifier :: proc(ast_context: ^AstContext, node: ast.Ident) -> (i return return_symbol, ok; } else if node.name == "context" { - return index.lookup("Context", ast_context.current_package); + for built in index.indexer.built_in_packages { + if symbol, ok := index.lookup("Context", built); ok { + return symbol, ok; + } + } } else if v, ok := common.keyword_map[node.name]; ok { //keywords ident := index.new_type(Ident, node.pos, node.end, context.temp_allocator); |