diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index af827b7a..55e1477d 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -13415,6 +13415,8 @@ BfIRValue BfModule::CastToFunction(BfAstNode* srcNode, const BfTypedValue& targe } if ((mCompiler->mOptions.mAllowHotSwapping) && (!mIsComptimeModule)) bindFuncVal = mBfIRBuilder->RemapBindFunction(bindFuncVal); + if ((bindFuncVal.IsFake()) && (!mBfIRBuilder->mIgnoreWrites)) + return GetDefaultValue(GetPrimitiveType(BfTypeCode_IntPtr)); return mBfIRBuilder->CreatePtrToInt(bindFuncVal, BfTypeCode_IntPtr); }