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

Fixed internal access inside generic specializations

This commit is contained in:
Brian Fiete 2022-02-11 11:23:46 -05:00
parent d9725dda7c
commit c8ba4a9e42
2 changed files with 12 additions and 1 deletions

View file

@ -3777,6 +3777,12 @@ BfInternalAccessSet* BfModule::GetInternalAccessSet()
bool BfModule::CheckInternalProtection(BfTypeDef* usingTypeDef) bool BfModule::CheckInternalProtection(BfTypeDef* usingTypeDef)
{ {
if ((mCurTypeInstance != NULL) && (mCurTypeInstance->IsSpecializedType()))
return true;
if ((mCurMethodInstance != NULL) &&
((mCurMethodInstance->mIsUnspecializedVariation) || (mCurMethodInstance->IsSpecializedGenericMethod())))
return true;
auto internalAccessSet = GetInternalAccessSet(); auto internalAccessSet = GetInternalAccessSet();
if (internalAccessSet == NULL) if (internalAccessSet == NULL)
return false; return false;
@ -22289,8 +22295,13 @@ void BfModule::StartMethodDeclaration(BfMethodInstance* methodInstance, BfMethod
if (methodInstance->mIsUnspecializedVariation) if (methodInstance->mIsUnspecializedVariation)
BF_ASSERT(methodInstance->mIsUnspecialized); BF_ASSERT(methodInstance->mIsUnspecialized);
//TODO: Why did we do this?
if (methodDef->mMethodType == BfMethodType_Mixin) if (methodDef->mMethodType == BfMethodType_Mixin)
{
if (methodInstance->IsSpecializedGenericMethod())
methodInstance->mIsUnspecializedVariation = true;
methodInstance->mIsUnspecialized = true; methodInstance->mIsUnspecialized = true;
}
} }
// methodDeclaration is NULL for default constructors // methodDeclaration is NULL for default constructors

View file

@ -6570,7 +6570,7 @@ void BfModule::AddMethodToWorkList(BfMethodInstance* methodInstance)
BF_ASSERT(mIsModuleMutable || mReifyQueued); BF_ASSERT(mIsModuleMutable || mReifyQueued);
} }
BF_ASSERT(mBfIRBuilder != NULL); BF_ASSERT((mBfIRBuilder != NULL) || (!methodInstance->mIsReified));
BfLogSysM("Adding to mMethodWorkList Module: %p IncompleteMethodCount: %d Type %p MethodInstance: %p Name:%s TypeRevision: %d ModuleRevision: %d ReqId:%d\n", this, mIncompleteMethodCount, typeInstance, methodInstance, methodInstance->mMethodDef->mName.c_str(), methodProcessRequest->mRevision, methodProcessRequest->mFromModuleRevision, methodProcessRequest->mReqId); BfLogSysM("Adding to mMethodWorkList Module: %p IncompleteMethodCount: %d Type %p MethodInstance: %p Name:%s TypeRevision: %d ModuleRevision: %d ReqId:%d\n", this, mIncompleteMethodCount, typeInstance, methodInstance, methodInstance->mMethodDef->mName.c_str(), methodProcessRequest->mRevision, methodProcessRequest->mFromModuleRevision, methodProcessRequest->mReqId);