1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed MethodToString for unspecialized type variations

This commit is contained in:
Brian Fiete 2020-09-19 05:12:15 -07:00
parent f8175e84a1
commit 76cd052c4a
7 changed files with 41 additions and 17 deletions

View file

@ -4841,18 +4841,20 @@ void BfModule::AddMethodToWorkList(BfMethodInstance* methodInstance)
if (methodInstance->IsSpecializedByAutoCompleteMethod())
return;
BF_ASSERT(mCompiler->mCompileState != BfCompiler::CompileState_VData);
if ((methodInstance->mIsReified) && (!methodInstance->mIsUnspecialized))
{
BF_ASSERT(mCompiler->mCompileState != BfCompiler::CompileState_Unreified);
}
if (methodInstance->mIsUnspecializedVariation)
if (methodInstance->IsOrInUnspecializedVariation())
{
return;
}
BF_ASSERT(!methodInstance->GetOwner()->IsUnspecializedTypeVariation());
BF_ASSERT(methodInstance->mMethodProcessRequest == NULL);
auto defaultMethod = methodInstance->mMethodInstanceGroup->mDefault;
@ -6705,8 +6707,9 @@ BfGenericParamInstance* BfModule::GetGenericTypeParamInstance(int genericParamId
{
// When we're evaluating a method, make sure the params refer back to that method context
auto curTypeInstance = mCurTypeInstance;
if (mCurMethodInstance != NULL)
curTypeInstance = mCurMethodInstance->mMethodInstanceGroup->mOwner;
//TODO: This caused MethodToString issues with interface "implementation method not found" errors
// if (mCurMethodInstance != NULL)
// curTypeInstance = mCurMethodInstance->mMethodInstanceGroup->mOwner;
BfTypeInstance* genericTypeInst = curTypeInstance->ToGenericTypeInstance();
if ((genericTypeInst->IsIncomplete()) && (genericTypeInst->mGenericTypeInfo->mGenericParams.size() == 0))
@ -7065,7 +7068,7 @@ BfType* BfModule::ResolveTypeResult(BfTypeReference* typeRef, BfType* resolvedTy
bool doValidate = (genericTypeInstance->mGenericTypeInfo->mHadValidateErrors) ||
(!genericTypeInstance->mGenericTypeInfo->mValidatedGenericConstraints) ||
(genericTypeInstance->mGenericTypeInfo->mIsUnspecializedVariation);
if ((mCurMethodInstance != NULL) && (mCurMethodInstance->mIsUnspecializedVariation))
if ((mCurMethodInstance != NULL) && (mCurMethodInstance->IsOrInUnspecializedVariation()))
doValidate = false;
if (mCurTypeInstance != NULL)
{