aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-11-07 05:15:36 -0500
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-11-07 05:18:57 -0500
commitcf74b5f1133217a7454b8b932e818e891ebdefb0 (patch)
tree2418af84f73a92e36591ae8c8752471b1e54732c /src
parent8d1626323b163cbce7b467b20d66c723e7605332 (diff)
Correctly resolve poly proc returns with #soa arrays
Diffstat (limited to 'src')
-rw-r--r--src/server/generics.odin2
-rw-r--r--src/server/symbol.odin15
2 files changed, 15 insertions, 2 deletions
diff --git a/src/server/generics.odin b/src/server/generics.odin
index 37546a2..fc22942 100644
--- a/src/server/generics.odin
+++ b/src/server/generics.odin
@@ -129,7 +129,6 @@ resolve_poly :: proc(
}
case ^ast.Dynamic_Array_Type:
if call_array, ok := call_node.derived.(^ast.Dynamic_Array_Type); ok {
-
if dynamic_array_is_soa(p^) != dynamic_array_is_soa(call_array^) {
return false
}
@@ -636,7 +635,6 @@ resolve_generic_function_symbol :: proc(
append(&return_types, field)
}
-
for param in params {
field := cast(^ast.Field)clone_node(param, ast_context.allocator, nil)
diff --git a/src/server/symbol.odin b/src/server/symbol.odin
index 6cf24df..5181ca3 100644
--- a/src/server/symbol.odin
+++ b/src/server/symbol.odin
@@ -821,11 +821,21 @@ symbol_to_expr :: proc(symbol: Symbol, file: string, allocator := context.temp_a
case SymbolDynamicArrayValue:
type := new_type(ast.Dynamic_Array_Type, pos, end, allocator)
type.elem = v.expr
+ if .Soa in symbol.flags {
+ directive := new_type(ast.Basic_Directive, pos, end, allocator)
+ directive.name = "soa"
+ type.tag = directive
+ }
return type
case SymbolFixedArrayValue:
type := new_type(ast.Array_Type, pos, end, allocator)
type.elem = v.expr
type.len = v.len
+ if .Soa in symbol.flags {
+ directive := new_type(ast.Basic_Directive, pos, end, allocator)
+ directive.name = "soa"
+ type.tag = directive
+ }
return type
case SymbolMapValue:
type := new_type(ast.Map_Type, pos, end, allocator)
@@ -837,6 +847,11 @@ symbol_to_expr :: proc(symbol: Symbol, file: string, allocator := context.temp_a
case SymbolSliceValue:
type := new_type(ast.Array_Type, pos, end, allocator)
type.elem = v.expr
+ if .Soa in symbol.flags {
+ directive := new_type(ast.Basic_Directive, pos, end, allocator)
+ directive.name = "soa"
+ type.tag = directive
+ }
return type
case SymbolStructValue:
type := new_type(ast.Struct_Type, pos, end, allocator)