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

Proper active project selection for CE typedecls

This commit is contained in:
Brian Fiete 2025-01-15 11:44:20 -08:00
parent 1e44392da8
commit d367213c31

View file

@ -3917,8 +3917,16 @@ addr_ce CeContext::GetReflectTypeDecl(int typeId)
if (bfType->mDefineState < BfTypeDefineState_HasCustomAttributes)
ceModule->PopulateType(bfType, BfPopulateType_CustomAttributes);
BfProject* curProject = NULL;
auto activeTypeDef = mCurModule->GetActiveTypeDef();
if (activeTypeDef != NULL)
curProject = activeTypeDef->mProject;
if (curProject == NULL)
return 0;
BfCreateTypeDataContext createTypeDataCtx;
auto irData = ceModule->CreateTypeDeclData(bfType, mCurModule->mProject);
auto irData = ceModule->CreateTypeDeclData(bfType, curProject);
BeValue* beValue = NULL;
if (auto constant = mCeMachine->mCeModule->mBfIRBuilder->GetConstant(irData))