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

Refactored generic type instances to be a BfGenericTypeInfo member

This commit is contained in:
Brian Fiete 2020-06-05 07:01:58 -07:00
parent 5d9a5f183d
commit 9f00539d90
16 changed files with 504 additions and 578 deletions

View file

@ -5845,10 +5845,10 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
if (genericParamInst->mTypeConstraint->IsGenericTypeInstance())
{
auto genericConstraintType = (BfGenericTypeInstance*)genericParamInst->mTypeConstraint;
auto genericConstraintType = (BfTypeInstance*)genericParamInst->mTypeConstraint;
if (genericConstraintType->mTypeDef == mCompiler->mSizedArrayTypeDef)
{
varType = genericConstraintType->mTypeGenericArguments[0];
varType = genericConstraintType->mGenericTypeInfo->mTypeGenericArguments[0];
isVarEnumerator = true;
}
}
@ -5909,7 +5909,7 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
{
PopulateType(itr.mType, BfPopulateType_DataAndMethods);
BfGenericTypeInstance* genericItrInterface = NULL;
BfTypeInstance* genericItrInterface = NULL;
auto _CheckInterface = [&](BfTypeInstance* interface)
{
@ -5924,7 +5924,7 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
genericItrInterface = itrInterface->ToGenericTypeInstance();
if (inferVarType)
{
varType = genericItrInterface->mTypeGenericArguments[0];
varType = genericItrInterface->mGenericTypeInfo->mTypeGenericArguments[0];
if (isRefExpression)
{
if (varType->IsPointer())
@ -5950,7 +5950,7 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
genericItrInterface = itrInterface->ToGenericTypeInstance();
if (inferVarType)
{
varType = genericItrInterface->mTypeGenericArguments[0];
varType = genericItrInterface->mGenericTypeInfo->mTypeGenericArguments[0];
if (isRefExpression)
{
if (varType->IsPointer())
@ -6093,7 +6093,7 @@ void BfModule::Visit(BfForEachStatement* forEachStmt)
if (nextResult.mType->IsGenericTypeInstance())
{
nextEmbeddedType = ((BfGenericTypeInstance*)nextResult.mType)->mTypeGenericArguments[0];
nextEmbeddedType = ((BfTypeInstance*)nextResult.mType)->mGenericTypeInfo->mTypeGenericArguments[0];
}
}
if (nextEmbeddedType == NULL)