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

New nullable support

This commit is contained in:
Brian Fiete 2019-11-21 08:23:18 -08:00
parent 59233cc996
commit 88adb3a1cd
16 changed files with 963 additions and 143 deletions

View file

@ -275,6 +275,30 @@ bool BfModule::AreConstraintsSubset(BfGenericParamInstance* checkInner, BfGeneri
return true;
}
bool BfModule::CheckConstraintState(BfAstNode* refNode)
{
if (mContext->mCurConstraintState == NULL)
return true;
auto checkState = mContext->mCurConstraintState->mPrevState;
while (checkState != NULL)
{
if (*checkState == *mContext->mCurConstraintState)
{
if (refNode != NULL)
{
Fail("Constraints cause circular operator invocations", refNode);
}
return false;
}
checkState = checkState->mPrevState;
}
return true;
}
bool BfModule::ShouldAllowMultipleDefinitions(BfTypeInstance* typeInst, BfTypeDef* firstDeclaringTypeDef, BfTypeDef* secondDeclaringTypeDef)
{
if (firstDeclaringTypeDef == secondDeclaringTypeDef)