mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Allow extensions to declare abstract methods
This commit is contained in:
parent
3cd94cbc8e
commit
16829900bc
2 changed files with 5 additions and 3 deletions
|
@ -5582,7 +5582,11 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance)
|
|||
{
|
||||
if (methodInstance->mMethodDef->mIsAbstract)
|
||||
{
|
||||
if (!typeInstance->IsUnspecializedTypeVariation())
|
||||
if (typeInstance->mVirtualMethodTable[methodIdx].mDeclaringMethod.mTypeInstance == typeInstance)
|
||||
{
|
||||
Fail("Method is abstract but it is declared in non-abstract class", methodInstance->mMethodDef->GetRefNode());
|
||||
}
|
||||
else if (!typeInstance->IsUnspecializedTypeVariation())
|
||||
{
|
||||
if (Fail(StrFormat("'%s' does not implement inherited abstract method '%s'", TypeToString(typeInstance).c_str(), MethodToString(methodInstance).c_str()), typeDef->mTypeDeclaration->mNameNode, true) != NULL)
|
||||
mCompiler->mPassInstance->MoreInfo("Abstract method declared", methodInstance->mMethodDef->GetRefNode());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue