diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2023-12-29 20:40:54 +0100 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2023-12-29 20:40:54 +0100 |
| commit | 02811e9a599845bb783e788271983df234fbdfbc (patch) | |
| tree | 58a23d611f18ad9a18df54f91635b2fa1324cbe4 | |
| parent | f4296894e1ef797a7c95997797c85d130e3847f5 (diff) | |
Remember to save the old call stack in ast_context.
| -rw-r--r-- | src/server/analysis.odin | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 1449eca..0789736 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -939,8 +939,13 @@ internal_resolve_type_expression :: proc( return symbol, ok case ^Call_Expr: + old_call := ast_context.call ast_context.call = cast(^Call_Expr)node + defer { + ast_context.call = old_call + } + if ident, ok := v.expr.derived.(^ast.Ident); ok && len(v.args) >= 1 { switch ident.name { case "type_of": @@ -2795,8 +2800,13 @@ get_generic_assignment :: proc( case ^Or_Return_Expr: get_generic_assignment(file, v.expr, ast_context, results, calls) case ^Call_Expr: + old_call := ast_context.call ast_context.call = cast(^ast.Call_Expr)value + defer { + ast_context.call = old_call + } + if symbol, ok := resolve_type_expression(ast_context, v.expr); ok { if procedure, ok := symbol.value.(SymbolProcedureValue); ok { for ret in procedure.return_types { |