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

Fixed some struct* constraint checking

This commit is contained in:
Brian Fiete 2021-12-17 12:56:51 -05:00
parent ecdc22920a
commit 69a597574d
3 changed files with 34 additions and 8 deletions

View file

@ -7787,9 +7787,16 @@ bool BfModule::CheckGenericConstraints(const BfGenericParamSource& genericParamS
}
}
if (checkArgType->IsPointer())
{
auto ptrType = (BfPointerType*)checkArgType;
checkArgType = ptrType->mElementType;
}
if ((genericParamInst->mGenericParamFlags & BfGenericParamFlag_New) != 0)
{
bool canAlloc = false;
if (auto checkTypeInst = checkArgType->ToTypeInstance())
{
if (checkTypeInst->IsObjectOrStruct())
@ -7857,13 +7864,7 @@ bool BfModule::CheckGenericConstraints(const BfGenericParamSource& genericParamS
}
if ((genericParamInst->mInterfaceConstraints.IsEmpty()) && (genericParamInst->mOperatorConstraints.IsEmpty()) && (genericParamInst->mTypeConstraint == NULL))
return true;
if (checkArgType->IsPointer())
{
auto ptrType = (BfPointerType*)checkArgType;
checkArgType = ptrType->mElementType;
}
return true;
if (genericParamInst->mTypeConstraint != NULL)
{