From 02811e9a599845bb783e788271983df234fbdfbc Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Fri, 29 Dec 2023 20:40:54 +0100 Subject: Remember to save the old call stack in ast_context. --- src/server/analysis.odin | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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 { -- cgit v1.2.3