Selaa lähdekoodia

Fixed internal access inside generic specializations

Brian Fiete 3 vuotta sitten
vanhempi
commit
c8ba4a9e42
2 muutettua tiedostoa jossa 12 lisäystä ja 1 poistoa
  1. 11 0
      IDEHelper/Compiler/BfModule.cpp
  2. 1 1
      IDEHelper/Compiler/BfModuleTypeUtils.cpp

+ 11 - 0
IDEHelper/Compiler/BfModule.cpp

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

+ 1 - 1
IDEHelper/Compiler/BfModuleTypeUtils.cpp

@@ -6570,7 +6570,7 @@ void BfModule::AddMethodToWorkList(BfMethodInstance* methodInstance)
 		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);