diff --git a/IDEHelper/Compiler/BfAutoComplete.cpp b/IDEHelper/Compiler/BfAutoComplete.cpp index 3594f962..dd943a18 100644 --- a/IDEHelper/Compiler/BfAutoComplete.cpp +++ b/IDEHelper/Compiler/BfAutoComplete.cpp @@ -980,8 +980,15 @@ void BfAutoComplete::AddTypeMembers(BfTypeInstance* typeInst, bool addStatic, bo } else { - canUseMethod &= (CHECK_STATIC(methodDef->mIsStatic) && - (mModule->CheckProtection(protectionCheckFlags, typeInst, methodDef->mDeclaringType->mProject, methodDef->mProtection, startType))); + if (typeInst->IsFunction()) + { + canUseMethod = true; + } + else + { + canUseMethod &= (CHECK_STATIC(methodDef->mIsStatic) && + (mModule->CheckProtection(protectionCheckFlags, typeInst, methodDef->mDeclaringType->mProject, methodDef->mProtection, startType))); + } } if (canUseMethod) { diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index c60e866e..33b32e7d 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -21803,7 +21803,7 @@ BfTypedValue BfExprEvaluator::SetupNullConditional(BfTypedValue thisValue, BfTok { // Success } - else if ((thisValue.mType->IsPointer()) || (thisValue.mType->IsObjectOrInterface())) + else if ((thisValue.mType->IsPointer()) || (thisValue.mType->IsObjectOrInterface()) || (thisValue.mType->IsFunction())) { // Also good } @@ -21863,6 +21863,10 @@ BfTypedValue BfExprEvaluator::SetupNullConditional(BfTypedValue thisValue, BfTok thisValue = BfTypedValue(valuePtr, elementType, true); } } + else if (thisValue.mType->IsFunction()) + { + isNotNull = mModule->mBfIRBuilder->CreateCmpNE(thisValue.mValue, mModule->GetDefaultValue(thisValue.mType)); + } else isNotNull = mModule->mBfIRBuilder->CreateIsNotNull(thisValue.mValue); BfIRBlock notNullBB = mModule->mBfIRBuilder->CreateBlock("nullCond.notNull");