1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Equality fix

This commit is contained in:
Brian Fiete 2020-09-17 05:21:38 -07:00
parent 8fe9843441
commit 74bbdbadbf

View file

@ -4181,20 +4181,14 @@ void BfModule::CreateFakeCallerMethod(const String& funcName)
}
void BfModule::CreateValueTypeEqualsMethod(bool strictEquals)
{
{
if (mCurMethodInstance->mIsUnspecialized)
return;
if (mBfIRBuilder->mIgnoreWrites)
return;
auto boolType = GetPrimitiveType(BfTypeCode_Boolean);
if (mCurTypeInstance->IsValuelessType())
{
mBfIRBuilder->CreateRet(GetDefaultValue(boolType));
return;
}
auto boolType = GetPrimitiveType(BfTypeCode_Boolean);
if (mCurTypeInstance->IsTypedPrimitive())
{
BfExprEvaluator exprEvaluator(this);
@ -4210,6 +4204,12 @@ void BfModule::CreateValueTypeEqualsMethod(bool strictEquals)
auto compareType = mCurMethodInstance->mParams[0].mResolvedType;
bool isValid = true;
if (compareType->IsValuelessType())
{
mBfIRBuilder->CreateRet(GetDefaultValue(boolType));
return;
}
auto compareDType = compareType->ToDependedType();
BfTypeInstance* compareTypeInst = compareType->ToTypeInstance();
if (compareTypeInst != NULL)