mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed attempt to declare base type for an interface
This commit is contained in:
parent
72126ba80c
commit
17b29c7227
1 changed files with 6 additions and 2 deletions
|
@ -3827,6 +3827,12 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((typeInstance->IsInterface()) && (baseTypeInst != NULL))
|
||||||
|
{
|
||||||
|
Fail("Interfaces cannot declare base types", baseTypeRef, true);
|
||||||
|
baseTypeInst = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if ((baseTypeInst != NULL) && (typeInstance->mBaseType == NULL))
|
if ((baseTypeInst != NULL) && (typeInstance->mBaseType == NULL))
|
||||||
{
|
{
|
||||||
if (typeInstance->mTypeFailed)
|
if (typeInstance->mTypeFailed)
|
||||||
|
@ -3848,14 +3854,12 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
if ((resolvedTypeRef->IsObject()) && (!baseTypeInst->IsObject()))
|
if ((resolvedTypeRef->IsObject()) && (!baseTypeInst->IsObject()))
|
||||||
{
|
{
|
||||||
Fail("Class can only derive from another class", baseTypeRef, true);
|
Fail("Class can only derive from another class", baseTypeRef, true);
|
||||||
//typeInstance->mTypeFailed = true;
|
|
||||||
baseTypeInst = defaultBaseTypeInst;
|
baseTypeInst = defaultBaseTypeInst;
|
||||||
typeInstance->mBaseType = baseTypeInst;
|
typeInstance->mBaseType = baseTypeInst;
|
||||||
}
|
}
|
||||||
else if ((resolvedTypeRef->IsStruct()) && (!baseTypeInst->IsValueType()))
|
else if ((resolvedTypeRef->IsStruct()) && (!baseTypeInst->IsValueType()))
|
||||||
{
|
{
|
||||||
Fail("Struct can only derive from another struct", baseTypeRef, true);
|
Fail("Struct can only derive from another struct", baseTypeRef, true);
|
||||||
//typeInstance->mTypeFailed = true;
|
|
||||||
baseTypeInst = defaultBaseTypeInst;
|
baseTypeInst = defaultBaseTypeInst;
|
||||||
typeInstance->mBaseType = baseTypeInst;
|
typeInstance->mBaseType = baseTypeInst;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue