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

Fixed comptime declaring type with types with extension

This commit is contained in:
Brian Fiete 2021-11-22 17:11:16 -08:00
parent 2a3efe3698
commit 6fe2a7002a
6 changed files with 54 additions and 21 deletions

View file

@ -2068,6 +2068,13 @@ void BfModule::UpdateCEEmit(CeEmitContext* ceEmitContext, BfTypeInstance* typeIn
BfDefBuilder defBuilder(mSystem);
defBuilder.mCurSource = emitParser;
defBuilder.mCurTypeDef = typeInstance->mTypeDef;
defBuilder.mCurDeclaringTypeDef = typeInstance->mTypeDef;
if (typeInstance->mTypeDef->mIsCombinedPartial)
{
// Always define generated methods on the primary type declaration
defBuilder.mCurDeclaringTypeDef = typeInstance->mTypeDef->mPartials[0]->GetLatest();
}
defBuilder.mPassInstance = mCompiler->mPassInstance;
defBuilder.mIsComptime = true;
defBuilder.DoVisitChild(typeDeclaration->mDefineNode);