mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Added warnings for invalid interface method decls
This commit is contained in:
parent
710d7636d6
commit
5167298ab2
1 changed files with 13 additions and 2 deletions
|
@ -21462,9 +21462,20 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
|
|||
}
|
||||
}
|
||||
|
||||
if ((typeInstance->IsInterface()) && (methodDef->mMethodType == BfMethodType_Ctor))
|
||||
if (typeInstance->IsInterface())
|
||||
{
|
||||
Fail("Interfaces cannot contain constructors", methodDeclaration);
|
||||
if (methodDef->mMethodType == BfMethodType_Ctor)
|
||||
Fail("Interfaces cannot contain constructors", methodDeclaration);
|
||||
if (methodDeclaration != NULL)
|
||||
{
|
||||
if (methodDef->mBody == NULL)
|
||||
{
|
||||
if (methodDef->mProtection != BfProtection_Public) //TODO: MAKE AN ERROR
|
||||
Warn(0, "Protection specifiers can only be used with interface methods containing a default implementation body", methodDeclaration->mProtectionSpecifier);
|
||||
if ((methodDeclaration->mVirtualSpecifier != NULL) && (methodDeclaration->mVirtualSpecifier->mToken != BfToken_Abstract)) //TODO: MAKE AN ERROR
|
||||
Warn(0, "Virtual specifiers can only be used with interface methods containing a default implementation body", methodDeclaration->mVirtualSpecifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool foundHiddenMethod = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue