mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Added warnings for illegal type specifiers
This commit is contained in:
parent
3e5c5e402c
commit
7f56fecc6c
1 changed files with 28 additions and 0 deletions
|
@ -1553,6 +1553,34 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
|
||||||
else
|
else
|
||||||
BF_FATAL("Unknown type token");
|
BF_FATAL("Unknown type token");
|
||||||
|
|
||||||
|
if (mCurTypeDef->mIsStatic)
|
||||||
|
{
|
||||||
|
if ((mCurTypeDef->mTypeCode != BfTypeCode_Object) &&
|
||||||
|
(mCurTypeDef->mTypeCode != BfTypeCode_Struct))
|
||||||
|
{
|
||||||
|
mPassInstance->Warn(0, StrFormat("Types declared as '%s' cannot be 'static'", BfTokenToString(typeToken)).c_str(), typeDeclaration->mStaticSpecifier);
|
||||||
|
mCurTypeDef->mIsStatic = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mCurTypeDef->mIsAbstract)
|
||||||
|
{
|
||||||
|
if (mCurTypeDef->mTypeCode != BfTypeCode_Object)
|
||||||
|
{
|
||||||
|
mPassInstance->Warn(0, StrFormat("Types declared as '%s' cannot be 'abstract'", BfTokenToString(typeToken)).c_str(), typeDeclaration->mStaticSpecifier);
|
||||||
|
mCurTypeDef->mIsAbstract = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mCurTypeDef->mIsConcrete)
|
||||||
|
{
|
||||||
|
if (mCurTypeDef->mTypeCode != BfTypeCode_Interface)
|
||||||
|
{
|
||||||
|
mPassInstance->Warn(0, StrFormat("Types declared as '%s' cannot be 'concrete'", BfTokenToString(typeToken)).c_str(), typeDeclaration->mStaticSpecifier);
|
||||||
|
mCurTypeDef->mIsConcrete = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!isAutoCompleteTempType)
|
if (!isAutoCompleteTempType)
|
||||||
{
|
{
|
||||||
BfTypeDef* prevDef = NULL;
|
BfTypeDef* prevDef = NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue