mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Fixed concrete return in interface extension
This commit is contained in:
parent
10f175b0c5
commit
ce96772054
3 changed files with 7 additions and 12 deletions
|
@ -445,16 +445,6 @@ BfMethodDef* BfDefBuilder::CreateMethodDef(BfMethodDeclaration* methodDeclaratio
|
||||||
methodDef->mIsVirtual = false;
|
methodDef->mIsVirtual = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCurTypeDef->mTypeCode == BfTypeCode_Interface)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (methodDef->mIsConcrete)
|
|
||||||
Fail("Only interfaces methods can be declared as 'concrete'", methodDeclaration->mVirtualSpecifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (methodDef->mIsAbstract)
|
if (methodDef->mIsAbstract)
|
||||||
{
|
{
|
||||||
if ((!mCurTypeDef->mIsAbstract) && (mCurTypeDef->mTypeCode != BfTypeCode_Interface))
|
if ((!mCurTypeDef->mIsAbstract) && (mCurTypeDef->mTypeCode != BfTypeCode_Interface))
|
||||||
|
|
|
@ -22780,6 +22780,11 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((methodDef->mIsConcrete) && (!methodInstance->mIsForeignMethodDef) && (!mCurTypeInstance->IsInterface()))
|
||||||
|
{
|
||||||
|
Fail("Only interfaces methods can be declared as 'concrete'", methodDeclaration->mVirtualSpecifier);
|
||||||
|
}
|
||||||
|
|
||||||
if ((methodDef->mIsVirtual) && (methodDef->mIsStatic) && (!methodInstance->mIsInnerOverride))
|
if ((methodDef->mIsVirtual) && (methodDef->mIsStatic) && (!methodInstance->mIsInnerOverride))
|
||||||
{
|
{
|
||||||
if ((virtualToken != NULL) && (virtualToken->mToken == BfToken_Override) && (methodDef->mDeclaringType->mTypeCode == BfTypeCode_Extension))
|
if ((virtualToken != NULL) && (virtualToken->mToken == BfToken_Override) && (methodDef->mDeclaringType->mTypeCode == BfTypeCode_Extension))
|
||||||
|
|
|
@ -8336,7 +8336,7 @@ BfTypeDef* BfModule::GetActiveTypeDef(BfTypeInstance* typeInstanceOverride, bool
|
||||||
useTypeDef = typeInstance->mTypeDef;
|
useTypeDef = typeInstance->mTypeDef;
|
||||||
if ((mCurMethodState != NULL) && (mCurMethodState->mMixinState != NULL) && (useMixinDecl))
|
if ((mCurMethodState != NULL) && (mCurMethodState->mMixinState != NULL) && (useMixinDecl))
|
||||||
useTypeDef = mCurMethodState->mMixinState->mMixinMethodInstance->mMethodDef->mDeclaringType;
|
useTypeDef = mCurMethodState->mMixinState->mMixinMethodInstance->mMethodDef->mDeclaringType;
|
||||||
else if ((mCurMethodInstance != NULL) && (mCurMethodInstance->mMethodDef->mDeclaringType != NULL))
|
else if ((mCurMethodInstance != NULL) && (!mCurMethodInstance->mIsForeignMethodDef) && (mCurMethodInstance->mMethodDef->mDeclaringType != NULL))
|
||||||
useTypeDef = mCurMethodInstance->mMethodDef->mDeclaringType;
|
useTypeDef = mCurMethodInstance->mMethodDef->mDeclaringType;
|
||||||
else if (mContext->mCurTypeState != NULL)
|
else if (mContext->mCurTypeState != NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue