mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +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 (typeInstance->mTypeFailed)
|
||||
|
@ -3848,14 +3854,12 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
if ((resolvedTypeRef->IsObject()) && (!baseTypeInst->IsObject()))
|
||||
{
|
||||
Fail("Class can only derive from another class", baseTypeRef, true);
|
||||
//typeInstance->mTypeFailed = true;
|
||||
baseTypeInst = defaultBaseTypeInst;
|
||||
typeInstance->mBaseType = baseTypeInst;
|
||||
}
|
||||
else if ((resolvedTypeRef->IsStruct()) && (!baseTypeInst->IsValueType()))
|
||||
{
|
||||
Fail("Struct can only derive from another struct", baseTypeRef, true);
|
||||
//typeInstance->mTypeFailed = true;
|
||||
baseTypeInst = defaultBaseTypeInst;
|
||||
typeInstance->mBaseType = baseTypeInst;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue