aboutsummaryrefslogtreecommitdiff
path: root/src/server/analysis.odin
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2025-08-07 15:15:27 +0200
committerGitHub <noreply@github.com>2025-08-07 15:15:27 +0200
commitf9c23d7ec2841d8580fb55acd4fb26aaae8d605b (patch)
treea78ece63bffafed2694ff6e453ff285df8c8f6ab /src/server/analysis.odin
parent0167f6c8f58bba8a014d53e3015f741b0b150fe9 (diff)
parent23219e126f8fc31dafb8dc6b5d9f7212483d803d (diff)
Merge pull request #824 from BradLewis/feat/resolve-poly-types
Resolve poly type variables
Diffstat (limited to 'src/server/analysis.odin')
-rw-r--r--src/server/analysis.odin16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin
index ab2efd7..47722e8 100644
--- a/src/server/analysis.odin
+++ b/src/server/analysis.odin
@@ -1168,6 +1168,8 @@ internal_resolve_type_expression :: proc(ast_context: ^AstContext, node: ^ast.Ex
if v.specialization != nil {
return internal_resolve_type_expression(ast_context, v.specialization, out)
}
+ out^ = make_symbol_poly_type_from_ast(ast_context, v.type)
+ return true
case:
log.warnf("default node kind, internal_resolve_type_expression: %v", v)
@@ -3096,6 +3098,20 @@ make_symbol_basic_type_from_ast :: proc(ast_context: ^AstContext, n: ^ast.Ident)
return symbol
}
+make_symbol_poly_type_from_ast :: proc(ast_context: ^AstContext, n: ^ast.Ident) -> Symbol {
+ symbol := Symbol {
+ range = common.get_token_range(n^, ast_context.file.src),
+ type = .Variable,
+ pkg = get_package_from_node(n^),
+ }
+
+ symbol.value = SymbolPolyTypeValue {
+ ident = n,
+ }
+
+ return symbol
+}
+
make_symbol_union_from_ast :: proc(
ast_context: ^AstContext,
v: ast.Union_Type,