mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Allowed more flexible attribute type lookup, supporting inner types
This commit is contained in:
parent
3509d659ea
commit
86d8f78761
5 changed files with 49 additions and 66 deletions
|
@ -6398,7 +6398,7 @@ BfTypeDef* BfModule::FindTypeDef(const StringImpl& typeName, int numGenericArgs,
|
|||
return result;
|
||||
}
|
||||
|
||||
BfTypeDef* BfModule::FindTypeDef(BfTypeReference* typeRef, BfTypeInstance* typeInstanceOverride, BfTypeLookupError* error, int numGenericParams)
|
||||
BfTypeDef* BfModule::FindTypeDef(BfTypeReference* typeRef, BfTypeInstance* typeInstanceOverride, BfTypeLookupError* error, int numGenericParams, BfResolveTypeRefFlags resolveFlags)
|
||||
{
|
||||
BP_ZONE("BfModule::FindTypeDef_5");
|
||||
|
||||
|
@ -6442,10 +6442,20 @@ BfTypeDef* BfModule::FindTypeDef(BfTypeReference* typeRef, BfTypeInstance* typeI
|
|||
}
|
||||
|
||||
BfSizedAtomComposite findName;
|
||||
if (!mSystem->ParseAtomComposite(findNameStr, findName))
|
||||
if ((resolveFlags & BfResolveTypeRefFlag_Attribute) != 0)
|
||||
{
|
||||
return NULL;
|
||||
String attributeName;
|
||||
attributeName += findNameStr;
|
||||
attributeName += "Attribute";
|
||||
if (!mSystem->ParseAtomComposite(attributeName, findName))
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!mSystem->ParseAtomComposite(findNameStr, findName))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#ifdef BF_AST_HAS_PARENT_MEMBER
|
||||
if (auto parentGenericTypeRef = BfNodeDynCast<BfGenericInstanceTypeRef>(typeRef->mParent))
|
||||
|
@ -6972,7 +6982,7 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
|
|||
{
|
||||
BfTypeLookupError error;
|
||||
error.mRefNode = typeRef;
|
||||
typeDef = FindTypeDef(typeRef, contextTypeInstance, &error);
|
||||
typeDef = FindTypeDef(typeRef, contextTypeInstance, &error, 0, resolveFlags);
|
||||
|
||||
if (auto namedTypeRef = BfNodeDynCast<BfNamedTypeReference>(typeRef))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue