From 6200806e94e86ed6b1ec338202b5257a86d21672 Mon Sep 17 00:00:00 2001 From: JohnnyMorganz Date: Sun, 24 Jul 2022 21:07:28 +0100 Subject: [PATCH] Store AstExprFunction in astTypes for stats --- Analysis/src/TypeInfer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Analysis/src/TypeInfer.cpp b/Analysis/src/TypeInfer.cpp index ea7d81e1..d460160c 100644 --- a/Analysis/src/TypeInfer.cpp +++ b/Analysis/src/TypeInfer.cpp @@ -3640,6 +3640,9 @@ void TypeChecker::checkFunctionBody(const ScopePtr& scope, TypeId ty, const AstE reportError(getEndLocation(function), FunctionExitsWithoutReturning{funTy->retTypes}); } } + + if (!currentModule->astTypes.find(&function)) + currentModule->astTypes[&function] = ty; } else ice("Checking non functional type");