mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +02:00
Fixed comptime declaring type with types with extension
This commit is contained in:
parent
2a3efe3698
commit
6fe2a7002a
6 changed files with 54 additions and 21 deletions
|
@ -59,6 +59,7 @@ BfDefBuilder::BfDefBuilder(BfSystem* bfSystem)
|
||||||
mPassInstance = NULL;
|
mPassInstance = NULL;
|
||||||
mSystem = bfSystem;
|
mSystem = bfSystem;
|
||||||
mCurTypeDef = NULL;
|
mCurTypeDef = NULL;
|
||||||
|
mCurDeclaringTypeDef = NULL;
|
||||||
mCurActualTypeDef = NULL;
|
mCurActualTypeDef = NULL;
|
||||||
mFullRefresh = false;
|
mFullRefresh = false;
|
||||||
mIsComptime = false;
|
mIsComptime = false;
|
||||||
|
@ -404,7 +405,8 @@ BfMethodDef* BfDefBuilder::CreateMethodDef(BfMethodDeclaration* methodDeclaratio
|
||||||
else
|
else
|
||||||
methodDef = new BfMethodDef();
|
methodDef = new BfMethodDef();
|
||||||
|
|
||||||
methodDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
methodDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
methodDef->mMethodDeclaration = methodDeclaration;
|
methodDef->mMethodDeclaration = methodDeclaration;
|
||||||
methodDef->mExplicitInterface = methodDeclaration->mExplicitInterface;
|
methodDef->mExplicitInterface = methodDeclaration->mExplicitInterface;
|
||||||
methodDef->mReturnTypeRef = methodDeclaration->mReturnType;
|
methodDef->mReturnTypeRef = methodDeclaration->mReturnType;
|
||||||
|
@ -703,7 +705,8 @@ BfMethodDef* BfDefBuilder::CreateMethodDef(BfMethodDeclaration* methodDeclaratio
|
||||||
fieldDef->mName = paramDef->mName;
|
fieldDef->mName = paramDef->mName;
|
||||||
fieldDef->mTypeRef = paramDef->mTypeRef;
|
fieldDef->mTypeRef = paramDef->mTypeRef;
|
||||||
fieldDef->mProtection = BfProtection_Public;
|
fieldDef->mProtection = BfProtection_Public;
|
||||||
fieldDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
fieldDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
fieldDef->mIdx = mCurTypeDef->mFields.mSize;
|
fieldDef->mIdx = mCurTypeDef->mFields.mSize;
|
||||||
if ((paramDef->mParamDeclaration->mModToken != NULL) &&
|
if ((paramDef->mParamDeclaration->mModToken != NULL) &&
|
||||||
(paramDef->mParamDeclaration->mModToken->mToken == BfToken_ReadOnly))
|
(paramDef->mParamDeclaration->mModToken->mToken == BfToken_ReadOnly))
|
||||||
|
@ -923,7 +926,8 @@ void BfDefBuilder::Visit(BfPropertyDeclaration* propertyDeclaration)
|
||||||
propertyDef->mTypeRef = propertyDeclaration->mTypeRef;
|
propertyDef->mTypeRef = propertyDeclaration->mTypeRef;
|
||||||
propertyDef->mInitializer = NULL;
|
propertyDef->mInitializer = NULL;
|
||||||
propertyDef->mFieldDeclaration = propertyDeclaration;
|
propertyDef->mFieldDeclaration = propertyDeclaration;
|
||||||
propertyDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
propertyDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
|
|
||||||
if (auto varType = BfNodeDynCast<BfLetTypeReference>(propertyDef->mTypeRef))
|
if (auto varType = BfNodeDynCast<BfLetTypeReference>(propertyDef->mTypeRef))
|
||||||
propertyDef->mIsReadOnly = true;
|
propertyDef->mIsReadOnly = true;
|
||||||
|
@ -948,7 +952,8 @@ void BfDefBuilder::Visit(BfPropertyDeclaration* propertyDeclaration)
|
||||||
if (needsAutoProperty)
|
if (needsAutoProperty)
|
||||||
{
|
{
|
||||||
BfFieldDef* fieldDef = new BfFieldDef();
|
BfFieldDef* fieldDef = new BfFieldDef();
|
||||||
fieldDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
fieldDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
fieldDef->mFieldDeclaration = propertyDeclaration;
|
fieldDef->mFieldDeclaration = propertyDeclaration;
|
||||||
fieldDef->mProtection = BfProtection_Hidden;
|
fieldDef->mProtection = BfProtection_Hidden;
|
||||||
fieldDef->mIsStatic = propertyDef->mIsStatic;
|
fieldDef->mIsStatic = propertyDef->mIsStatic;
|
||||||
|
@ -989,7 +994,8 @@ void BfDefBuilder::Visit(BfPropertyDeclaration* propertyDeclaration)
|
||||||
|
|
||||||
auto methodDef = new BfMethodDef();
|
auto methodDef = new BfMethodDef();
|
||||||
mCurTypeDef->mMethods.push_back(methodDef);
|
mCurTypeDef->mMethods.push_back(methodDef);
|
||||||
methodDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
methodDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
methodDef->mMethodDeclaration = methodDeclaration;
|
methodDef->mMethodDeclaration = methodDeclaration;
|
||||||
methodDef->mProtection = propertyDef->mProtection;
|
methodDef->mProtection = propertyDef->mProtection;
|
||||||
methodDef->mWantsBody = (methodDeclaration->mBody != NULL) && (WantsNode(methodDeclaration->mBody));
|
methodDef->mWantsBody = (methodDeclaration->mBody != NULL) && (WantsNode(methodDeclaration->mBody));
|
||||||
|
@ -1108,7 +1114,8 @@ void BfDefBuilder::Visit(BfFieldDeclaration* fieldDeclaration)
|
||||||
auto fieldDef = new BfFieldDef();
|
auto fieldDef = new BfFieldDef();
|
||||||
mCurTypeDef->mFields.push_back(fieldDef);
|
mCurTypeDef->mFields.push_back(fieldDef);
|
||||||
fieldDef->mFieldDeclaration = fieldDeclaration;
|
fieldDef->mFieldDeclaration = fieldDeclaration;
|
||||||
fieldDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
fieldDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
if (fieldDeclaration->mNameNode != NULL)
|
if (fieldDeclaration->mNameNode != NULL)
|
||||||
fieldDef->mName = fieldDeclaration->mNameNode->ToString();
|
fieldDef->mName = fieldDeclaration->mNameNode->ToString();
|
||||||
fieldDef->mProtection = GetProtection(fieldDeclaration->mProtectionSpecifier);
|
fieldDef->mProtection = GetProtection(fieldDeclaration->mProtectionSpecifier);
|
||||||
|
@ -1409,6 +1416,7 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
|
||||||
actualOuterTypeDef = actualOuterTypeDef->mOuterType;
|
actualOuterTypeDef = actualOuterTypeDef->mOuterType;
|
||||||
|
|
||||||
SetAndRestoreValue<BfTypeDef*> prevTypeDef(mCurTypeDef, new BfTypeDef());
|
SetAndRestoreValue<BfTypeDef*> prevTypeDef(mCurTypeDef, new BfTypeDef());
|
||||||
|
SetAndRestoreValue<BfTypeDef*> prevDeclaringTypeDef(mCurDeclaringTypeDef, mCurTypeDef);
|
||||||
SetAndRestoreValue<BfTypeDef*> prevActualTypeDef(mCurActualTypeDef, mCurTypeDef);
|
SetAndRestoreValue<BfTypeDef*> prevActualTypeDef(mCurActualTypeDef, mCurTypeDef);
|
||||||
|
|
||||||
mCurTypeDef->mSystem = mSystem;
|
mCurTypeDef->mSystem = mSystem;
|
||||||
|
@ -1967,7 +1975,8 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
|
||||||
|
|
||||||
auto methodDef = new BfMethodDef();
|
auto methodDef = new BfMethodDef();
|
||||||
mCurTypeDef->mMethods.Insert(methodIdx + 1, methodDef);
|
mCurTypeDef->mMethods.Insert(methodIdx + 1, methodDef);
|
||||||
methodDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
methodDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
methodDef->mName = BF_METHODNAME_CALCAPPEND;
|
methodDef->mName = BF_METHODNAME_CALCAPPEND;
|
||||||
methodDef->mProtection = BfProtection_Public;
|
methodDef->mProtection = BfProtection_Public;
|
||||||
methodDef->mMethodType = BfMethodType_CtorCalcAppend;
|
methodDef->mMethodType = BfMethodType_CtorCalcAppend;
|
||||||
|
@ -2240,7 +2249,8 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
|
||||||
{
|
{
|
||||||
auto methodDef = new BfMethodDef();
|
auto methodDef = new BfMethodDef();
|
||||||
mCurTypeDef->mMethods.push_back(methodDef);
|
mCurTypeDef->mMethods.push_back(methodDef);
|
||||||
methodDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
methodDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
methodDef->mName = BF_METHODNAME_ENUM_HASFLAG;
|
methodDef->mName = BF_METHODNAME_ENUM_HASFLAG;
|
||||||
methodDef->mReturnTypeRef = mSystem->mDirectBoolTypeRef;
|
methodDef->mReturnTypeRef = mSystem->mDirectBoolTypeRef;
|
||||||
methodDef->mProtection = BfProtection_Public;
|
methodDef->mProtection = BfProtection_Public;
|
||||||
|
@ -2251,7 +2261,8 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
|
||||||
{
|
{
|
||||||
auto methodDef = new BfMethodDef();
|
auto methodDef = new BfMethodDef();
|
||||||
mCurTypeDef->mMethods.push_back(methodDef);
|
mCurTypeDef->mMethods.push_back(methodDef);
|
||||||
methodDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
methodDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
methodDef->mName = BF_METHODNAME_ENUM_GETUNDERLYING;
|
methodDef->mName = BF_METHODNAME_ENUM_GETUNDERLYING;
|
||||||
methodDef->mReturnTypeRef = mSystem->mDirectSelfBaseTypeRef;
|
methodDef->mReturnTypeRef = mSystem->mDirectSelfBaseTypeRef;
|
||||||
methodDef->mMethodType = BfMethodType_PropertyGetter;
|
methodDef->mMethodType = BfMethodType_PropertyGetter;
|
||||||
|
@ -2261,7 +2272,8 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
|
||||||
auto propDef = new BfPropertyDef();
|
auto propDef = new BfPropertyDef();
|
||||||
mCurTypeDef->mProperties.Add(propDef);
|
mCurTypeDef->mProperties.Add(propDef);
|
||||||
propDef->mTypeRef = mSystem->mDirectSelfBaseTypeRef;
|
propDef->mTypeRef = mSystem->mDirectSelfBaseTypeRef;
|
||||||
propDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
methodDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
propDef->mName = "Underlying";
|
propDef->mName = "Underlying";
|
||||||
propDef->mMethods.Add(methodDef);
|
propDef->mMethods.Add(methodDef);
|
||||||
propDef->mProtection = BfProtection_Public;
|
propDef->mProtection = BfProtection_Public;
|
||||||
|
@ -2271,7 +2283,8 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
|
||||||
{
|
{
|
||||||
auto methodDef = new BfMethodDef();
|
auto methodDef = new BfMethodDef();
|
||||||
mCurTypeDef->mMethods.push_back(methodDef);
|
mCurTypeDef->mMethods.push_back(methodDef);
|
||||||
methodDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
methodDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
methodDef->mIsMutating = true;
|
methodDef->mIsMutating = true;
|
||||||
methodDef->mName = BF_METHODNAME_ENUM_GETUNDERLYINGREF;
|
methodDef->mName = BF_METHODNAME_ENUM_GETUNDERLYINGREF;
|
||||||
methodDef->mReturnTypeRef = mSystem->mDirectRefSelfBaseTypeRef;
|
methodDef->mReturnTypeRef = mSystem->mDirectRefSelfBaseTypeRef;
|
||||||
|
@ -2282,7 +2295,8 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
|
||||||
auto propDef = new BfPropertyDef();
|
auto propDef = new BfPropertyDef();
|
||||||
mCurTypeDef->mProperties.Add(propDef);
|
mCurTypeDef->mProperties.Add(propDef);
|
||||||
propDef->mTypeRef = mSystem->mDirectRefSelfBaseTypeRef;
|
propDef->mTypeRef = mSystem->mDirectRefSelfBaseTypeRef;
|
||||||
propDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
propDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
propDef->mName = "UnderlyingRef";
|
propDef->mName = "UnderlyingRef";
|
||||||
propDef->mMethods.Add(methodDef);
|
propDef->mMethods.Add(methodDef);
|
||||||
propDef->mProtection = BfProtection_Public;
|
propDef->mProtection = BfProtection_Public;
|
||||||
|
@ -2293,7 +2307,8 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
|
||||||
{
|
{
|
||||||
auto methodDef = new BfMethodDef();
|
auto methodDef = new BfMethodDef();
|
||||||
mCurTypeDef->mMethods.push_back(methodDef);
|
mCurTypeDef->mMethods.push_back(methodDef);
|
||||||
methodDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
methodDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
methodDef->mName = BF_METHODNAME_TO_STRING;
|
methodDef->mName = BF_METHODNAME_TO_STRING;
|
||||||
methodDef->mReturnTypeRef = mSystem->mDirectVoidTypeRef;
|
methodDef->mReturnTypeRef = mSystem->mDirectVoidTypeRef;
|
||||||
methodDef->mProtection = BfProtection_Public;
|
methodDef->mProtection = BfProtection_Public;
|
||||||
|
@ -2308,7 +2323,8 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
|
||||||
{
|
{
|
||||||
auto methodDef = new BfMethodDef();
|
auto methodDef = new BfMethodDef();
|
||||||
mCurTypeDef->mMethods.push_back(methodDef);
|
mCurTypeDef->mMethods.push_back(methodDef);
|
||||||
methodDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
methodDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
methodDef->mName = BF_METHODNAME_DEFAULT_EQUALS;
|
methodDef->mName = BF_METHODNAME_DEFAULT_EQUALS;
|
||||||
methodDef->mReturnTypeRef = mSystem->mDirectBoolTypeRef;
|
methodDef->mReturnTypeRef = mSystem->mDirectBoolTypeRef;
|
||||||
methodDef->mProtection = BfProtection_Private;
|
methodDef->mProtection = BfProtection_Private;
|
||||||
|
@ -2322,7 +2338,8 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
|
||||||
{
|
{
|
||||||
auto methodDef = new BfMethodDef();
|
auto methodDef = new BfMethodDef();
|
||||||
mCurTypeDef->mMethods.push_back(methodDef);
|
mCurTypeDef->mMethods.push_back(methodDef);
|
||||||
methodDef->mDeclaringType = mCurTypeDef;
|
BF_ASSERT(mCurDeclaringTypeDef != NULL);
|
||||||
|
methodDef->mDeclaringType = mCurDeclaringTypeDef;
|
||||||
methodDef->mName = BF_METHODNAME_DEFAULT_STRICT_EQUALS;
|
methodDef->mName = BF_METHODNAME_DEFAULT_STRICT_EQUALS;
|
||||||
methodDef->mReturnTypeRef = mSystem->mDirectBoolTypeRef;
|
methodDef->mReturnTypeRef = mSystem->mDirectBoolTypeRef;
|
||||||
methodDef->mProtection = BfProtection_Private;
|
methodDef->mProtection = BfProtection_Private;
|
||||||
|
|
|
@ -16,6 +16,7 @@ public:
|
||||||
BfSystem* mSystem;
|
BfSystem* mSystem;
|
||||||
BfPassInstance* mPassInstance;
|
BfPassInstance* mPassInstance;
|
||||||
BfTypeDef* mCurTypeDef;
|
BfTypeDef* mCurTypeDef;
|
||||||
|
BfTypeDef* mCurDeclaringTypeDef;
|
||||||
BfTypeDef* mCurActualTypeDef;
|
BfTypeDef* mCurActualTypeDef;
|
||||||
bool mFullRefresh;
|
bool mFullRefresh;
|
||||||
bool mIsComptime;
|
bool mIsComptime;
|
||||||
|
|
|
@ -16566,7 +16566,7 @@ void BfModule::EmitInitBlocks(const std::function<void(BfAstNode*)>& initBlockCa
|
||||||
|
|
||||||
for (; initMethodDef != NULL; initMethodDef = initMethodDef->mNextWithSameName)
|
for (; initMethodDef != NULL; initMethodDef = initMethodDef->mNextWithSameName)
|
||||||
{
|
{
|
||||||
if (initMethodDef->mDeclaringType != methodDef->mDeclaringType)
|
if (initMethodDef->mDeclaringType->GetDefinition() != methodDef->mDeclaringType->GetDefinition())
|
||||||
continue;
|
continue;
|
||||||
if (initMethodDef->mMethodType != BfMethodType_Init)
|
if (initMethodDef->mMethodType != BfMethodType_Init)
|
||||||
continue;
|
continue;
|
||||||
|
@ -20617,7 +20617,7 @@ BfMethodDef* BfModule::GetLocalMethodDef(BfLocalMethod* localMethod)
|
||||||
defBuilder.mCurSource = localMethod->mMethodDeclaration->GetParser();
|
defBuilder.mCurSource = localMethod->mMethodDeclaration->GetParser();
|
||||||
defBuilder.mPassInstance = mCompiler->mPassInstance;
|
defBuilder.mPassInstance = mCompiler->mPassInstance;
|
||||||
defBuilder.mCurTypeDef = mCurMethodInstance->mMethodDef->mDeclaringType;
|
defBuilder.mCurTypeDef = mCurMethodInstance->mMethodDef->mDeclaringType;
|
||||||
|
defBuilder.mCurDeclaringTypeDef = defBuilder.mCurTypeDef;
|
||||||
methodDef = defBuilder.CreateMethodDef(methodDeclaration, outerMethodDef);
|
methodDef = defBuilder.CreateMethodDef(methodDeclaration, outerMethodDef);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -2068,6 +2068,13 @@ void BfModule::UpdateCEEmit(CeEmitContext* ceEmitContext, BfTypeInstance* typeIn
|
||||||
BfDefBuilder defBuilder(mSystem);
|
BfDefBuilder defBuilder(mSystem);
|
||||||
defBuilder.mCurSource = emitParser;
|
defBuilder.mCurSource = emitParser;
|
||||||
defBuilder.mCurTypeDef = typeInstance->mTypeDef;
|
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.mPassInstance = mCompiler->mPassInstance;
|
||||||
defBuilder.mIsComptime = true;
|
defBuilder.mIsComptime = true;
|
||||||
defBuilder.DoVisitChild(typeDeclaration->mDefineNode);
|
defBuilder.DoVisitChild(typeDeclaration->mDefineNode);
|
||||||
|
|
|
@ -2621,6 +2621,7 @@ void BfTupleType::Finish()
|
||||||
|
|
||||||
BfDefBuilder bfDefBuilder(bfSystem);
|
BfDefBuilder bfDefBuilder(bfSystem);
|
||||||
bfDefBuilder.mCurTypeDef = mTypeDef;
|
bfDefBuilder.mCurTypeDef = mTypeDef;
|
||||||
|
bfDefBuilder.mCurDeclaringTypeDef = mTypeDef;
|
||||||
bfDefBuilder.FinishTypeDef(true);
|
bfDefBuilder.FinishTypeDef(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3222,6 +3222,9 @@ void BfSystem::CopyTypeDef(BfTypeDef* typeDef, BfTypeDef* fromTypeDef)
|
||||||
*methodDef = *fromMethodDef;
|
*methodDef = *fromMethodDef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (methodDef->mDeclaringType == fromTypeDef)
|
||||||
|
methodDef->mDeclaringType = typeDef;
|
||||||
|
|
||||||
for (int paramIdx = 0; paramIdx < fromMethodDef->mParams.mSize; paramIdx++)
|
for (int paramIdx = 0; paramIdx < fromMethodDef->mParams.mSize; paramIdx++)
|
||||||
{
|
{
|
||||||
auto fromParamDef = fromMethodDef->mParams[paramIdx];
|
auto fromParamDef = fromMethodDef->mParams[paramIdx];
|
||||||
|
@ -3254,6 +3257,8 @@ void BfSystem::CopyTypeDef(BfTypeDef* typeDef, BfTypeDef* fromTypeDef)
|
||||||
{
|
{
|
||||||
BfPropertyDef* propDef = new BfPropertyDef();
|
BfPropertyDef* propDef = new BfPropertyDef();
|
||||||
*propDef = *fromPropDef;
|
*propDef = *fromPropDef;
|
||||||
|
if (propDef->mDeclaringType == fromTypeDef)
|
||||||
|
propDef->mDeclaringType = typeDef;
|
||||||
for (auto& methodDef : propDef->mMethods)
|
for (auto& methodDef : propDef->mMethods)
|
||||||
methodDef = typeDef->mMethods[methodDef->mIdx];
|
methodDef = typeDef->mMethods[methodDef->mIdx];
|
||||||
propDef->mNextWithSameName = NULL;
|
propDef->mNextWithSameName = NULL;
|
||||||
|
@ -3264,6 +3269,8 @@ void BfSystem::CopyTypeDef(BfTypeDef* typeDef, BfTypeDef* fromTypeDef)
|
||||||
{
|
{
|
||||||
BfFieldDef* fieldDef = new BfFieldDef();
|
BfFieldDef* fieldDef = new BfFieldDef();
|
||||||
*fieldDef = *fromField;
|
*fieldDef = *fromField;
|
||||||
|
if (fieldDef->mDeclaringType == fromTypeDef)
|
||||||
|
fieldDef->mDeclaringType = typeDef;
|
||||||
fieldDef->mNextWithSameName = NULL;
|
fieldDef->mNextWithSameName = NULL;
|
||||||
typeDef->mFields.Add(fieldDef);
|
typeDef->mFields.Add(fieldDef);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue