From 6021518343e8722b3bffd7972627b0749fbcf838 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 1 Jul 2020 09:54:16 -0700 Subject: [PATCH] Fixed methodRef dependency, fixed var handling for expression bodies --- IDEHelper/Compiler/BfModule.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 296e5454..b6f3887e 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -11276,6 +11276,9 @@ void BfModule::AddMethodReference(const BfMethodRef& methodRef, BfGetMethodInsta { BF_ASSERT(!methodRef.mTypeInstance->IsFunction()); + // This ensures we rebuild - there are some cases where we get a method reference but never call it, so this is required here + AddDependency(methodInstance->GetOwner(), mCurTypeInstance, BfDependencyMap::DependencyFlag_Calls); + BfMethodRef methodRef = methodInstance; BfSpecializedMethodRefInfo* specializedMethodRefInfo = NULL; bool isNew = mCurTypeInstance->mSpecializedMethodReferences.TryAdd(methodRef, NULL, &specializedMethodRefInfo); @@ -18007,7 +18010,7 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup) UpdateSrcPos(expressionBody); auto retVal = CreateValueFromExpression(expressionBody, expectingType, exprEvalFlags); - if ((retVal) && (expectingType != NULL)) + if ((retVal) && (!retVal.mType->IsVar()) && (expectingType != NULL)) { mCurMethodState->mHadReturn = true; retVal = LoadValue(retVal);