1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fixed missing concrete type case in ResolveGenericType

This commit is contained in:
Brian Fiete 2021-01-20 06:34:49 -08:00
parent b3599251ac
commit b283cb0aab
2 changed files with 15 additions and 8 deletions

View file

@ -3909,16 +3909,9 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
if (!isUnion) if (!isUnion)
{ {
if (!resolvedFieldType->IsValuelessType()) if (!resolvedFieldType->IsValuelessType())
{
if (isCRepr)
{ {
dataFieldVec.push_back(fieldInstance); dataFieldVec.push_back(fieldInstance);
} }
else
{
dataFieldVec.push_back(fieldInstance);
}
}
} }
else else
{ {
@ -7158,6 +7151,18 @@ BfType* BfModule::ResolveGenericType(BfType* unspecializedType, BfTypeVector* ty
return CreatePointerType(elementType); return CreatePointerType(elementType);
} }
if (unspecializedType->IsConcreteInterfaceType())
{
auto concreteType = (BfConcreteInterfaceType*)unspecializedType;
auto elementType = ResolveGenericType(concreteType->GetUnderlyingType(), typeGenericArguments, methodGenericArguments, allowFail);
if (elementType == NULL)
return NULL;
auto elementTypeInstance = elementType->ToTypeInstance();
if (elementTypeInstance == NULL)
return unspecializedType;
return CreateConcreteInterfaceType(elementTypeInstance);
}
if (unspecializedType->IsArray()) if (unspecializedType->IsArray())
{ {
auto arrayType = (BfArrayType*)unspecializedType; auto arrayType = (BfArrayType*)unspecializedType;

View file

@ -2182,6 +2182,8 @@ public:
virtual bool IsConcreteInterfaceType() override { return true; } virtual bool IsConcreteInterfaceType() override { return true; }
virtual bool IsDependentOnUnderlyingType() override { return true; } virtual bool IsDependentOnUnderlyingType() override { return true; }
virtual BfType* GetUnderlyingType() override { return mInterface; } virtual BfType* GetUnderlyingType() override { return mInterface; }
virtual bool IsUnspecializedType() override { return mInterface->IsUnspecializedType(); }
virtual bool IsUnspecializedTypeVariation() override { return mInterface->IsUnspecializedTypeVariation(); }
}; };
class BfPointerType : public BfType class BfPointerType : public BfType