1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

EnumType.UnderlyingType support, generic enum constraint improvements

This commit is contained in:
Brian Fiete 2022-01-03 07:30:03 -05:00
parent 64161bf001
commit 1ee0a19bbf
5 changed files with 74 additions and 2 deletions

View file

@ -64,6 +64,22 @@ bool BfTypedValue::CanModify() const
//////////////////////////////////////////////////////////////////////////
bool BfGenericParamInstance::IsEnum()
{
if ((mGenericParamFlags & BfGenericParamFlag_Enum) != 0)
return true;
if (mTypeConstraint != NULL)
{
auto module = mTypeConstraint->GetModule();
if ((module != NULL) && (mTypeConstraint->IsInstanceOf(module->mCompiler->mEnumTypeDef)))
return true;
}
return true;
return false;
}
//////////////////////////////////////////////////////////////////////////
bool BfDependencyMap::AddUsedBy(BfType* dependentType, BfDependencyMap::DependencyFlags flags)
{
BF_ASSERT(dependentType != NULL);