mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Fixed improper generic method variation reification
This commit is contained in:
parent
8c2d65ca78
commit
42ae46390d
2 changed files with 25 additions and 14 deletions
|
@ -11423,22 +11423,26 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM
|
|||
{
|
||||
if ((mIsReified) && (!instModule->mIsReified))
|
||||
{
|
||||
if (!instModule->mReifyQueued)
|
||||
if (!typeInst->IsUnspecializedTypeVariation())
|
||||
{
|
||||
BF_ASSERT((mCompiler->mCompileState != BfCompiler::CompileState_Unreified) && (mCompiler->mCompileState != BfCompiler::CompileState_VData));
|
||||
BfLogSysM("Queueing ReifyModule: %p\n", instModule);
|
||||
mContext->mReifyModuleWorkList.Add(instModule);
|
||||
instModule->mReifyQueued = true;
|
||||
}
|
||||
if (!instModule->mReifyQueued)
|
||||
{
|
||||
BF_ASSERT((instModule != mContext->mUnreifiedModule) && (instModule != mContext->mScratchModule));
|
||||
BF_ASSERT((mCompiler->mCompileState != BfCompiler::CompileState_Unreified) && (mCompiler->mCompileState != BfCompiler::CompileState_VData));
|
||||
BfLogSysM("Queueing ReifyModule: %p\n", instModule);
|
||||
mContext->mReifyModuleWorkList.Add(instModule);
|
||||
instModule->mReifyQueued = true;
|
||||
}
|
||||
|
||||
// This ensures that the method will actually be created when it gets reified
|
||||
BfMethodSpecializationRequest* specializationRequest = mContext->mMethodSpecializationWorkList.Alloc();
|
||||
specializationRequest->mFromModule = typeInst->mModule;
|
||||
specializationRequest->mFromModuleRevision = typeInst->mModule->mRevision;
|
||||
specializationRequest->mMethodDef = methodDef;
|
||||
specializationRequest->mMethodGenericArguments = methodGenericArguments;
|
||||
specializationRequest->mType = typeInst;
|
||||
specializationRequest->mFlags = flags;
|
||||
// This ensures that the method will actually be created when it gets reified
|
||||
BfMethodSpecializationRequest* specializationRequest = mContext->mMethodSpecializationWorkList.Alloc();
|
||||
specializationRequest->mFromModule = typeInst->mModule;
|
||||
specializationRequest->mFromModuleRevision = typeInst->mModule->mRevision;
|
||||
specializationRequest->mMethodDef = methodDef;
|
||||
specializationRequest->mMethodGenericArguments = methodGenericArguments;
|
||||
specializationRequest->mType = typeInst;
|
||||
specializationRequest->mFlags = flags;
|
||||
}
|
||||
}
|
||||
|
||||
auto defFlags = (BfGetMethodInstanceFlags)(flags & ~BfGetMethodInstanceFlag_ForceInline);
|
||||
|
@ -19307,6 +19311,11 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
|
|||
if (methodDef->mMethodType == BfMethodType_Mixin)
|
||||
methodInstance->mIsUnspecialized = true;
|
||||
|
||||
if (methodInstance->mIsUnspecialized)
|
||||
{
|
||||
//BF_ASSERT(methodInstance->mDeclModule == methodInstance->GetOwner()->mModule);
|
||||
}
|
||||
|
||||
BfAutoComplete* bfAutocomplete = NULL;
|
||||
if (mCompiler->mResolvePassData != NULL)
|
||||
bfAutocomplete = mCompiler->mResolvePassData->mAutoComplete;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue