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

Strip ref from comptype, rettype

This commit is contained in:
Brian Fiete 2021-11-23 10:43:51 -08:00
parent 12a3ba937a
commit 8922cc0c0d
2 changed files with 12 additions and 1 deletions

View file

@ -9780,6 +9780,8 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
if (invokeMethodInstance != NULL)
{
resolvedType = invokeMethodInstance->mReturnType;
if ((resolvedType != NULL) && (resolvedType->IsRef()))
resolvedType = resolvedType->GetUnderlyingType();
return ResolveTypeResult(typeRef, resolvedType, populateType, resolveFlags);
}
}
@ -9813,6 +9815,8 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
{
auto methodRefType = (BfMethodRefType*)innerType;
resolvedType = methodRefType->mMethodRef->mReturnType;
if ((resolvedType != NULL) && (resolvedType->IsRef()))
resolvedType = resolvedType->GetUnderlyingType();
return ResolveTypeResult(typeRef, resolvedType, populateType, resolveFlags);
}
}

View file

@ -3420,6 +3420,8 @@ int BfResolvedTypeSet::DoHash(BfTypeReference* typeRef, LookupContext* ctx, BfHa
if (ctx->mRootTypeRef != retTypeTypeRef)
{
auto type = ctx->mModule->ResolveTypeRef(retTypeTypeRef, BfPopulateType_Identity, ctx->mResolveFlags);
if ((type != NULL) && (type->IsRef()))
type = type->GetUnderlyingType();
return Hash(type, ctx, flags, hashSeed);
}
@ -3538,6 +3540,9 @@ int BfResolvedTypeSet::DoHash(BfTypeReference* typeRef, LookupContext* ctx, BfHa
else
cachedResolvedType = result.mType;
if ((cachedResolvedType != NULL) && (cachedResolvedType->IsRef()))
cachedResolvedType = cachedResolvedType->GetUnderlyingType();
if (cachedResolvedType != NULL)
ctx->SetCachedResolvedType(typeRef, cachedResolvedType);
}
@ -3999,6 +4004,8 @@ bool BfResolvedTypeSet::Equals(BfType* lhs, BfTypeReference* rhs, LookupContext*
if (auto retTypeRef = BfNodeDynCastExact<BfModifiedTypeRef>(rhs))
{
auto resolvedType = ctx->mModule->ResolveTypeRef(rhs);
if ((resolvedType != NULL) && (resolvedType->IsRef()))
resolvedType = resolvedType->GetUnderlyingType();
return lhs == resolvedType;
}
}