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

Improved generic param reflection in comptime

This commit is contained in:
Brian Fiete 2022-01-31 15:41:05 -05:00
parent 157d3f90e5
commit 26506efc1e
9 changed files with 143 additions and 19 deletions

View file

@ -10593,15 +10593,8 @@ void BfExprEvaluator::Visit(BfTypeOfExpression* typeOfExpr)
return;
}
if ((type->IsGenericParam()) && (!mModule->mIsComptimeModule))
{
mResult = BfTypedValue(mModule->mBfIRBuilder->GetUndefConstValue(mModule->mBfIRBuilder->MapType(typeType)), typeType);
}
else
{
mModule->AddDependency(type, mModule->mCurTypeInstance, BfDependencyMap::DependencyFlag_ExprTypeReference);
mResult = BfTypedValue(mModule->CreateTypeDataRef(type), typeType);
}
mModule->AddDependency(type, mModule->mCurTypeInstance, BfDependencyMap::DependencyFlag_ExprTypeReference);
mResult = BfTypedValue(mModule->CreateTypeDataRef(type), typeType);
}
bool BfExprEvaluator::LookupTypeProp(BfTypeOfExpression* typeOfExpr, BfIdentifierNode* propName)