Fixed a bug in the type system with consecutive calls

This commit is contained in:
Mattia Giambirtone 2022-08-19 09:08:49 +02:00
parent 66b409bbd4
commit 885d6e3ea8
1 changed files with 3 additions and 1 deletions

View File

@ -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: