1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-18 16:10:26 +02:00

Merge branch 'master' into hunterbridges/HotSwapDialog

This commit is contained in:
Hunter Bridges 2021-05-04 17:42:14 -07:00
commit dd523bb24d

View file

@ -18586,18 +18586,21 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup)
{
if (methodDef->mIsStatic)
{
auto checkParam0 = mCurMethodInstance->GetParamType(0);
if ((checkParam0->IsRef()) && (!checkParam0->IsOut()))
checkParam0 = checkParam0->GetUnderlyingType();
if (methodDef->mParams.size() != 1)
{
Fail("Unary operators must declare one parameter", paramErrorRefNode);
}
else if ((checkParam0 != mCurTypeInstance) && (!checkParam0->IsSelf()))
else
{
auto checkParam0 = mCurMethodInstance->GetParamType(0);
if ((checkParam0->IsRef()) && (!checkParam0->IsOut()))
checkParam0 = checkParam0->GetUnderlyingType();
if ((checkParam0 != mCurTypeInstance) && (!checkParam0->IsSelf()))
{
Fail("The parameter of a unary operator must be the containing type", paramErrorRefNode);
}
}
if (((operatorDef->mOperatorDeclaration->mUnaryOp == BfUnaryOp_Increment) ||
(operatorDef->mOperatorDeclaration->mUnaryOp == BfUnaryOp_Decrement)) &&