diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2026-01-24 09:57:59 +1100 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2026-01-24 09:57:59 +1100 |
| commit | ce092169ca1d65b0c66fd2d81b0f00b828cf2e8c (patch) | |
| tree | c14dd23e0d3903de6a9d7819829308786a6c71cf /src | |
| parent | 7a2c58610ac31f815bf058523e3d3a22dc04defe (diff) | |
Correctly resolve child parapoly structs
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/generics.odin | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/server/generics.odin b/src/server/generics.odin index db858cc..8aa111f 100644 --- a/src/server/generics.odin +++ b/src/server/generics.odin @@ -793,6 +793,14 @@ resolve_poly_struct :: proc(ast_context: ^AstContext, b: ^SymbolStructValueBuild v.elem = expr case ^ast.Pointer_Type: v.elem = expr + case ^ast.Call_Expr: + for arg, i in v.args { + if call_ident, ok := arg.derived.(^ast.Ident); ok { + if ident.name == call_ident.name { + v.args[i] = expr + } + } + } } } else if data.parent_proc == nil { data.symbol_value_builder.types[data.i] = expr @@ -806,6 +814,8 @@ resolve_poly_struct :: proc(ast_context: ^AstContext, b: ^SymbolStructValueBuild data.parent = node case ^ast.Proc_Type: data.parent_proc = v + case ^ast.Call_Expr: + data.parent = v } return visitor |