1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Fixed generic tuple issue

This commit is contained in:
Brian Fiete 2020-12-24 13:01:58 -08:00
parent 90d4b84d95
commit 2130b7d60c
2 changed files with 4 additions and 4 deletions

View file

@ -129,6 +129,9 @@ bool BfModule::InitGenericParams(BfType* resolvedTypeRef)
auto genericTypeInst = resolvedTypeRef->ToGenericTypeInstance(); auto genericTypeInst = resolvedTypeRef->ToGenericTypeInstance();
genericTypeInst->mGenericTypeInfo->mInitializedGenericParams = true; genericTypeInst->mGenericTypeInfo->mInitializedGenericParams = true;
if (genericTypeInst->mGenericTypeInfo->mTypeGenericArguments.IsEmpty())
return true;
if (genericTypeInst->mGenericTypeInfo->mTypeGenericArguments[0]->IsGenericParam()) if (genericTypeInst->mGenericTypeInfo->mTypeGenericArguments[0]->IsGenericParam())
{ {
BF_ASSERT(genericTypeInst->mGenericTypeInfo->mIsUnspecialized); BF_ASSERT(genericTypeInst->mGenericTypeInfo->mIsUnspecialized);
@ -9062,10 +9065,7 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
if (type->IsUnspecializedType()) if (type->IsUnspecializedType())
isUnspecialized = true; isUnspecialized = true;
BF_ASSERT(!type->IsVar()); BF_ASSERT(!type->IsVar());
// if (type->IsVar())
// isUnspecialized = true;
String typeName = TypeToString(type);
types.push_back(type); types.push_back(type);
names.push_back(fieldName); names.push_back(fieldName);
} }

View file

@ -2239,7 +2239,7 @@ BfType* BfTypeInstance::GetUnderlyingType()
{ {
if (!mIsTypedPrimitive) if (!mIsTypedPrimitive)
{ {
if (mGenericTypeInfo != NULL) if ((mGenericTypeInfo != NULL) && (!mGenericTypeInfo->mTypeGenericArguments.IsEmpty()))
return mGenericTypeInfo->mTypeGenericArguments[0]; return mGenericTypeInfo->mTypeGenericArguments[0];
return NULL; return NULL;
} }