From 885d6e3ea8e749027de91f40a0100d7aa1585a00 Mon Sep 17 00:00:00 2001 From: Mattia Giambirtone Date: Fri, 19 Aug 2022 09:08:49 +0200 Subject: [PATCH] Fixed a bug in the type system with consecutive calls --- src/frontend/compiler.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/compiler.nim b/src/frontend/compiler.nim index de71377..73539e0 100644 --- a/src/frontend/compiler.nim +++ b/src/frontend/compiler.nim @@ -671,7 +671,9 @@ proc inferType(self: Compiler, node: Expression): Type = of lambdaExpr: result = self.inferType(LambdaExpr(node.callee).returnType) of callExpr: - result = self.inferType(CallExpr(node.callee).callee) + result = self.inferType(CallExpr(node.callee)) + if not result.isNil(): + result = result.returnType else: discard # Unreachable of varExpr: