Fix array type check

This commit is contained in:
drmortalwombat 2021-11-04 18:28:35 +01:00
parent fe155d40d4
commit d51a30ed2e

View File

@ -403,7 +403,7 @@ bool Declaration::IsSubType(const Declaration* dec) const
return true; return true;
else if (mType == DT_TYPE_BOOL || mType == DT_TYPE_FLOAT || mType == DT_TYPE_VOID) else if (mType == DT_TYPE_BOOL || mType == DT_TYPE_FLOAT || mType == DT_TYPE_VOID)
return true; return true;
else if (mType == DT_TYPE_STRUCT || mType == DT_TYPE_ENUM || DT_TYPE_UNION) else if (mType == DT_TYPE_STRUCT || mType == DT_TYPE_ENUM || mType == DT_TYPE_UNION)
return false; return false;
else if (mType == DT_TYPE_ARRAY) else if (mType == DT_TYPE_ARRAY)
return mSize <= dec->mSize && mBase->IsSubType(dec->mBase); return mSize <= dec->mSize && mBase->IsSubType(dec->mBase);