From 3a668695ef9eaba59a6425672e6dd8d972bed4c9 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 25 Sep 2024 11:32:49 -0400 Subject: [PATCH] "Cannot bind to const-eval method, as this method is not available at runtime" --- IDEHelper/Compiler/BfExprEvaluator.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index f92a2217..c80085be 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -13462,6 +13462,11 @@ void BfExprEvaluator::Visit(BfDelegateBindExpression* delegateBindExpr) return; } + if (((bindResult.mMethodInstance->mComptimeFlags & BfComptimeFlag_Comptime) != 0) && ((mModule->mCurMethodInstance->mComptimeFlags & BfComptimeFlag_Comptime) == 0)) + { + mModule->Fail(StrFormat("Cannot bind to const-eval method '%s', as this method is not available at runtime", mModule->MethodToString(bindResult.mMethodInstance).c_str()), delegateBindExpr->mTarget); + } + auto bindMethodInstance = bindResult.mMethodInstance; if (isMethodRefMatch) {