diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 6f6eee04..30702e46 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -5442,11 +5442,13 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu if ((argValue) && (arg != NULL)) { - // + if (mModule->mCurMethodState != NULL) { SetAndRestoreValue prevScopeData(mModule->mCurMethodState->mOverrideScope, boxScopeData); argValue = mModule->Cast(arg, argValue, wantType); } + else + argValue = mModule->Cast(arg, argValue, wantType); if (!argValue) {