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

Made typeof(T) evaluate as undef

This commit is contained in:
Brian Fiete 2021-11-23 15:09:17 -08:00
parent a7da8a75d6
commit 048c1c1ab8

View file

@ -10269,8 +10269,15 @@ void BfExprEvaluator::Visit(BfTypeOfExpression* typeOfExpr)
return;
}
mModule->AddDependency(type, mModule->mCurTypeInstance, BfDependencyMap::DependencyFlag_ExprTypeReference);
mResult = BfTypedValue(mModule->CreateTypeDataRef(type), typeType);
if (type->IsGenericParam())
{
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);
}
}
bool BfExprEvaluator::LookupTypeProp(BfTypeOfExpression* typeOfExpr, BfIdentifierNode* propName)