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

Better handling of let/var field failures

This commit is contained in:
Brian Fiete 2025-01-23 09:10:00 -08:00
parent 624e36b89b
commit b63b4af6fe
5 changed files with 59 additions and 8 deletions

View file

@ -6099,6 +6099,9 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
std::function<void(BfType*)> splatIterate;
splatIterate = [&](BfType* checkType)
{
if (hadNonSplattable)
return;
if (checkType->IsValueType())
PopulateType(checkType, BfPopulateType_Data);
@ -6135,6 +6138,13 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
for (int fieldIdx = 0; fieldIdx < (int)checkTypeInstance->mFieldInstances.size(); fieldIdx++)
{
auto fieldInstance = (BfFieldInstance*)&checkTypeInstance->mFieldInstances[fieldIdx];
if ((fieldInstance->mResolvedType->IsVar()) || (fieldInstance->mResolvedType->IsLet()))
{
//TODO: allow splattables with var/let field types
hadNonSplattable = true;
}
if (fieldInstance->mDataIdx >= 0)
splatIterate(fieldInstance->GetResolvedType());
}