diff --git a/IDEHelper/Compiler/BfDefBuilder.cpp b/IDEHelper/Compiler/BfDefBuilder.cpp index 07da63b0..07275424 100644 --- a/IDEHelper/Compiler/BfDefBuilder.cpp +++ b/IDEHelper/Compiler/BfDefBuilder.cpp @@ -447,8 +447,6 @@ BfMethodDef* BfDefBuilder::CreateMethodDef(BfMethodDeclaration* methodDeclaratio if (methodDef->mIsAbstract) { - if ((!mCurTypeDef->mIsAbstract) && (mCurTypeDef->mTypeCode != BfTypeCode_Interface)) - Fail("Method is abstract but it is contained in non-abstract class", methodDeclaration); if (methodDeclaration->mBody != NULL) Fail("Abstract method cannot declare a body", methodDeclaration); } diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index 73af5357..d34957c9 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -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());