mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Equality fix
This commit is contained in:
parent
8fe9843441
commit
74bbdbadbf
1 changed files with 8 additions and 8 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue