mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed type generic constraint validation
This commit is contained in:
parent
b9d82107bb
commit
adb0bc4b85
2 changed files with 12 additions and 3 deletions
|
@ -9335,12 +9335,19 @@ BfMethodInstance* BfModule::GetRawMethodInstanceAtIdx(BfTypeInstance* typeInstan
|
||||||
{
|
{
|
||||||
if (!mCompiler->mIsResolveOnly)
|
if (!mCompiler->mIsResolveOnly)
|
||||||
{
|
{
|
||||||
|
// Get it from the owning module so we don't create a reference prematurely...
|
||||||
|
auto declModule = typeInstance->mModule;
|
||||||
|
|
||||||
|
if ((typeInstance->mGenericTypeInfo != NULL) && (typeInstance->mGenericTypeInfo->mFinishedGenericParams) && (methodGroup.mOnDemandKind == BfMethodOnDemandKind_NotSet))
|
||||||
|
{
|
||||||
|
methodGroup.mOnDemandKind = BfMethodOnDemandKind_NoDecl_AwaitingReference;
|
||||||
|
declModule->mOnDemandMethodCount++;
|
||||||
|
}
|
||||||
|
|
||||||
BF_ASSERT((methodGroup.mOnDemandKind == BfMethodOnDemandKind_AlwaysInclude) || (methodGroup.mOnDemandKind == BfMethodOnDemandKind_NoDecl_AwaitingReference) || (methodGroup.mOnDemandKind == BfMethodOnDemandKind_Decl_AwaitingDecl) || (typeInstance->mTypeFailed));
|
BF_ASSERT((methodGroup.mOnDemandKind == BfMethodOnDemandKind_AlwaysInclude) || (methodGroup.mOnDemandKind == BfMethodOnDemandKind_NoDecl_AwaitingReference) || (methodGroup.mOnDemandKind == BfMethodOnDemandKind_Decl_AwaitingDecl) || (typeInstance->mTypeFailed));
|
||||||
if ((methodGroup.mOnDemandKind == BfMethodOnDemandKind_NoDecl_AwaitingReference) || (methodGroup.mOnDemandKind == BfMethodOnDemandKind_Decl_AwaitingDecl))
|
if ((methodGroup.mOnDemandKind == BfMethodOnDemandKind_NoDecl_AwaitingReference) || (methodGroup.mOnDemandKind == BfMethodOnDemandKind_Decl_AwaitingDecl))
|
||||||
methodGroup.mOnDemandKind = BfMethodOnDemandKind_Decl_AwaitingDecl;
|
methodGroup.mOnDemandKind = BfMethodOnDemandKind_Decl_AwaitingDecl;
|
||||||
|
|
||||||
// Get it from the owning module so we don't create a reference prematurely...
|
|
||||||
auto declModule = typeInstance->mModule;
|
|
||||||
return declModule->GetMethodInstance(typeInstance, typeInstance->mTypeDef->mMethods[methodIdx], BfTypeVector(), (BfGetMethodInstanceFlags)(BfGetMethodInstanceFlag_UnspecializedPass | BfGetMethodInstanceFlag_Unreified)).mMethodInstance;
|
return declModule->GetMethodInstance(typeInstance, typeInstance->mTypeDef->mMethods[methodIdx], BfTypeVector(), (BfGetMethodInstanceFlags)(BfGetMethodInstanceFlag_UnspecializedPass | BfGetMethodInstanceFlag_Unreified)).mMethodInstance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -316,6 +316,8 @@ bool BfModule::ValidateGenericConstraints(BfTypeReference* typeRef, BfTypeInstan
|
||||||
|
|
||||||
SetAndRestoreValue<bool> prevIgnoreErrors(mIgnoreErrors, mIgnoreErrors || ignoreErrors);
|
SetAndRestoreValue<bool> prevIgnoreErrors(mIgnoreErrors, mIgnoreErrors || ignoreErrors);
|
||||||
genericTypeInst->mGenericTypeInfo->mValidatedGenericConstraints = true;
|
genericTypeInst->mGenericTypeInfo->mValidatedGenericConstraints = true;
|
||||||
|
if (!genericTypeInst->mGenericTypeInfo->mFinishedGenericParams)
|
||||||
|
PopulateType(genericTypeInst, BfPopulateType_Interfaces);
|
||||||
|
|
||||||
if (genericTypeInst->IsTypeAlias())
|
if (genericTypeInst->IsTypeAlias())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue