aboutsummaryrefslogtreecommitdiff
path: root/src/server/analysis.odin
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-05-06 20:52:53 +0200
committerGitHub <noreply@github.com>2024-05-06 20:52:53 +0200
commit5c646656e988ddcdaee09f1bea666dc00ea2ea4d (patch)
tree8b21d0a8704999b033e6e8429398fda0144060cb /src/server/analysis.odin
parente1cad51b26559f769b27f1608f59e4cb8f4a6503 (diff)
parentd8a37f7cf6875cc0e6eba74368541840e0bfd227 (diff)
Merge pull request #378 from thetarnav/no-symbol-for-nil
Don't make a symbol for `nil`
Diffstat (limited to 'src/server/analysis.odin')
-rw-r--r--src/server/analysis.odin14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index 2f1035d..a75b574 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -1308,27 +1308,25 @@ internal_resolve_type_identifier :: proc(
ident := new_type(Ident, node.pos, node.end, ast_context.allocator)
ident.name = node.name
- symbol: Symbol
-
switch ident.name {
+ case "nil":
+ return {}, false
case "true", "false":
- symbol = Symbol {
+ return {
type = .Keyword,
signature = node.name,
pkg = ast_context.current_package,
value = SymbolUntypedValue{type = .Bool},
- }
+ }, true
case:
- symbol = Symbol {
+ return {
type = .Keyword,
signature = node.name,
name = ident.name,
pkg = ast_context.current_package,
value = SymbolBasicValue{ident = ident},
- }
+ }, true
}
-
- return symbol, true
}
if local, ok := get_local(ast_context, node.pos.offset, node.name);