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

Added Obsolete support for moved collections

This commit is contained in:
Brian Fiete 2020-04-29 09:53:48 -07:00
parent dbd9b32e3f
commit 842a6a8898
16 changed files with 232 additions and 109 deletions

View file

@ -949,6 +949,7 @@ bool BfModule::PopulateType(BfType* resolvedTypeRef, BfPopulateType populateType
}
resolvedTypeRef->mDefineState = BfTypeDefineState_DefinedAndMethodsSlotted;
resolvedTypeRef->mRebuildFlags = BfTypeRebuildFlag_None;
typeAlias->mCustomAttributes = GetCustomAttributes(typeDef->mTypeDeclaration->mAttributes, BfAttributeTargets_Alias);
return true;
}
@ -6046,10 +6047,9 @@ BfType* BfModule::ResolveTypeResult(BfTypeReference* typeRef, BfType* resolvedTy
}
}
BfGenericTypeInstance* genericTypeInstance = NULL;
if (resolvedTypeRef != NULL)
genericTypeInstance = resolvedTypeRef->ToGenericTypeInstance();
BfTypeInstance* typeInstance = resolvedTypeRef->ToTypeInstance();
BfGenericTypeInstance* genericTypeInstance = resolvedTypeRef->ToGenericTypeInstance();
bool hadError = false;
hadError = !PopulateType(resolvedTypeRef, populateType);
@ -6064,13 +6064,25 @@ BfType* BfModule::ResolveTypeResult(BfTypeReference* typeRef, BfType* resolvedTy
if (populateType != BfPopulateType_IdentityNoRemapAlias)
{
while ((resolvedTypeRef != NULL) && (resolvedTypeRef->IsTypeAlias()))
{
{
if (mCurTypeInstance != NULL)
AddDependency(resolvedTypeRef, mCurTypeInstance, BfDependencyMap::DependencyFlag_NameReference);
if ((typeInstance->mCustomAttributes != NULL) && (!typeRef->IsTemporary()))
CheckErrorAttributes(typeInstance, NULL, typeInstance->mCustomAttributes, typeRef);
resolvedTypeRef = resolvedTypeRef->GetUnderlyingType();
if (resolvedTypeRef != NULL)
typeInstance = resolvedTypeRef->ToTypeInstance();
else
typeInstance = NULL;
}
}
if (typeInstance != NULL)
{
if ((typeInstance->mCustomAttributes != NULL) && (!typeRef->IsTemporary()))
CheckErrorAttributes(typeInstance, NULL, typeInstance->mCustomAttributes, typeRef);
}
return resolvedTypeRef;
}
@ -10416,6 +10428,12 @@ void BfModule::DoTypeToString(StringImpl& str, BfType* resolvedType, BfTypeNameF
// We don't want the param names, just the commas (this is an unspecialized type reference)
if (i > prevGenericParamCount)
str += ',';
if ((typeNameFlags & BfTypeNameFlag_UseUnspecializedGenericParamNames) != 0)
{
str += checkTypeDef->mGenericParamDefs[i]->mName;
}
continue;
}
}