mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Tightened std type lookup requirements, fixed reified redecl issue
This commit is contained in:
parent
fbe9a906e4
commit
85b4afcd94
3 changed files with 26 additions and 12 deletions
|
@ -6231,10 +6231,10 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
return typeDef;
|
||||
};
|
||||
|
||||
mArray1TypeDef = _GetRequiredType("System.Array1");
|
||||
mArray2TypeDef = _GetRequiredType("System.Array2");
|
||||
mArray3TypeDef = _GetRequiredType("System.Array3");
|
||||
mArray4TypeDef = _GetRequiredType("System.Array4");
|
||||
mArray1TypeDef = _GetRequiredType("System.Array1", 1);
|
||||
mArray2TypeDef = _GetRequiredType("System.Array2", 1);
|
||||
mArray3TypeDef = _GetRequiredType("System.Array3", 1);
|
||||
mArray4TypeDef = _GetRequiredType("System.Array4", 1);
|
||||
mSpanTypeDef = _GetRequiredType("System.Span", 1);
|
||||
mAttributeTypeDef = _GetRequiredType("System.Attribute");
|
||||
mAttributeUsageAttributeTypeDef = _GetRequiredType("System.AttributeUsageAttribute");
|
||||
|
@ -6270,7 +6270,7 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
mLinkNameAttributeTypeDef = _GetRequiredType("System.LinkNameAttribute");
|
||||
mCallingConventionAttributeTypeDef = _GetRequiredType("System.CallingConventionAttribute");
|
||||
mMethodRefTypeDef = _GetRequiredType("System.MethodReference", 1);
|
||||
mNullableTypeDef = _GetRequiredType("System.Nullable");
|
||||
mNullableTypeDef = _GetRequiredType("System.Nullable", 1);
|
||||
mOrderedAttributeTypeDef = _GetRequiredType("System.OrderedAttribute");
|
||||
mPointerTTypeDef = _GetRequiredType("System.Pointer", 1);
|
||||
mPointerTypeDef = _GetRequiredType("System.Pointer", 0);
|
||||
|
|
|
@ -2188,12 +2188,13 @@ void BfContext::GenerateModuleName_TypeInst(BfTypeInstance* typeInst, String& na
|
|||
return;
|
||||
}
|
||||
|
||||
for (int genericIdx = startGenericIdx; genericIdx < (int)typeInst->mTypeDef->mGenericParamDefs.size(); genericIdx++)
|
||||
if (typeInst->mGenericTypeInfo != NULL)
|
||||
{
|
||||
auto genericType = (BfTypeInstance*)typeInst;
|
||||
|
||||
auto type = genericType->mGenericTypeInfo->mTypeGenericArguments[genericIdx];
|
||||
GenerateModuleName_Type(type, name);
|
||||
for (int genericIdx = startGenericIdx; genericIdx < (int)typeInst->mGenericTypeInfo->mTypeGenericArguments.size(); genericIdx++)
|
||||
{
|
||||
auto type = typeInst->mGenericTypeInfo->mTypeGenericArguments[genericIdx];
|
||||
GenerateModuleName_Type(type, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2363,6 +2364,11 @@ void BfContext::QueueMethodSpecializations(BfTypeInstance* typeInst, bool checkS
|
|||
|
||||
BP_ZONE("BfContext::QueueMethodSpecializations");
|
||||
|
||||
if (typeInst->mTypeId == 578)
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
|
||||
auto module = typeInst->mModule;
|
||||
if (module == NULL)
|
||||
return;
|
||||
|
@ -2408,6 +2414,11 @@ void BfContext::QueueMethodSpecializations(BfTypeInstance* typeInst, bool checkS
|
|||
|
||||
auto methodDef = methodRef.mTypeInstance->mTypeDef->mMethods[methodRef.mMethodNum];
|
||||
|
||||
if (methodDef->mName == "set__Capacity")
|
||||
{
|
||||
NOP;
|
||||
}
|
||||
|
||||
auto targetContext = methodRef.mTypeInstance->mContext;
|
||||
BfMethodSpecializationRequest* specializationRequest = targetContext->mMethodSpecializationWorkList.Alloc();
|
||||
if (specializedMethodRefInfo.mHasReifiedRef)
|
||||
|
|
|
@ -11450,6 +11450,7 @@ bool BfModule::IsCompatibleInterfaceMethod(BfMethodInstance* iMethodInst, BfMeth
|
|||
void BfModule::AddMethodReference(const BfMethodRef& methodRef, BfGetMethodInstanceFlags flags)
|
||||
{
|
||||
BfMethodInstance* methodInstance = methodRef;
|
||||
|
||||
if ((mCurTypeInstance != NULL) && (!mCompiler->IsAutocomplete()))
|
||||
{
|
||||
auto methodInstanceGroup = methodInstance->mMethodInstanceGroup;
|
||||
|
@ -12300,6 +12301,8 @@ BfModuleMethodInstance BfModule::GetMethodInstance(BfTypeInstance* typeInst, BfM
|
|||
}
|
||||
|
||||
BfModule* declareModule = GetOrCreateMethodModule(methodInstance);
|
||||
if ((doingRedeclare) && (methodInstance->mDeclModule != mContext->mUnreifiedModule))
|
||||
declareModule = methodInstance->mDeclModule;
|
||||
|
||||
BF_ASSERT(typeInst == methodInstance->GetOwner());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue