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

DynamicCastToSignature release fix

This commit is contained in:
Brian Fiete 2025-03-22 16:08:14 -04:00
parent 37f72cd3b6
commit c7da3e15f9
4 changed files with 9 additions and 9 deletions

View file

@ -130,13 +130,13 @@ namespace System
{ {
return null; return null;
} }
#endif
[NoShow] [NoShow]
public virtual Object DynamicCastToSignature(int32 sig) public virtual Object DynamicCastToSignature(int32 sig)
{ {
return null; return null;
} }
#endif
int IHashable.GetHashCode() int IHashable.GetHashCode()
{ {

View file

@ -1355,9 +1355,9 @@ BfMethodDef* BfDefBuilder::AddDtor(BfTypeDef* typeDef)
return methodDef; return methodDef;
} }
void BfDefBuilder::AddDynamicCastMethods(BfTypeDef* typeDef) void BfDefBuilder::AddDynamicCastMethods(BfTypeDef* typeDef, bool needsDynamicCastMethods)
{ {
// if (needsDynamicCastMethods)
{ {
auto methodDef = new BfMethodDef(); auto methodDef = new BfMethodDef();
methodDef->mIdx = (int)typeDef->mMethods.size(); methodDef->mIdx = (int)typeDef->mMethods.size();
@ -1378,7 +1378,7 @@ void BfDefBuilder::AddDynamicCastMethods(BfTypeDef* typeDef)
methodDef->mIsNoReflect = true; methodDef->mIsNoReflect = true;
} }
// if (needsDynamicCastMethods)
{ {
auto methodDef = new BfMethodDef(); auto methodDef = new BfMethodDef();
methodDef->mIdx = (int)typeDef->mMethods.size(); methodDef->mIdx = (int)typeDef->mMethods.size();
@ -2392,10 +2392,10 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
isAutocomplete = true; isAutocomplete = true;
//TODO: Don't do this for the autocomplete pass //TODO: Don't do this for the autocomplete pass
if ((needsDynamicCastMethod) && (mCurTypeDef->mTypeCode != BfTypeCode_Interface) && (mCurTypeDef->mTypeCode != BfTypeCode_Extension) && if ((mCurTypeDef->mTypeCode != BfTypeCode_Interface) && (mCurTypeDef->mTypeCode != BfTypeCode_Extension) &&
(!mCurTypeDef->mIsStatic) && (!isAutocomplete) && (!isAlias) && (!mCurTypeDef->mIsOpaque)) (!mCurTypeDef->mIsStatic) && (!isAutocomplete) && (!isAlias) && (!mCurTypeDef->mIsOpaque))
{ {
AddDynamicCastMethods(mCurTypeDef); AddDynamicCastMethods(mCurTypeDef, needsDynamicCastMethod);
} }
bool isPayloadEnum = false; bool isPayloadEnum = false;

View file

@ -52,7 +52,7 @@ public:
static BfFieldDef* AddField(BfTypeDef* typeDef, BfTypeReference* typeRef, const StringImpl& name); static BfFieldDef* AddField(BfTypeDef* typeDef, BfTypeReference* typeRef, const StringImpl& name);
static BfMethodDef* AddMethod(BfTypeDef* typeDef, BfMethodType methodType, BfProtection protection, bool isStatic, const StringImpl& name, bool addedAfterEmit = false); static BfMethodDef* AddMethod(BfTypeDef* typeDef, BfMethodType methodType, BfProtection protection, bool isStatic, const StringImpl& name, bool addedAfterEmit = false);
static BfMethodDef* AddDtor(BfTypeDef* typeDef); static BfMethodDef* AddDtor(BfTypeDef* typeDef);
static void AddDynamicCastMethods(BfTypeDef* typeDef); static void AddDynamicCastMethods(BfTypeDef* typeDef, bool needsDynamicCastMethods);
static void AddParam(BfMethodDef* methodDef, BfTypeReference* typeRef, const StringImpl& paramName); static void AddParam(BfMethodDef* methodDef, BfTypeReference* typeRef, const StringImpl& paramName);
BfTypeDef* ComparePrevTypeDef(BfTypeDef* prevTypeDef, BfTypeDef* checkTypeDef); BfTypeDef* ComparePrevTypeDef(BfTypeDef* prevTypeDef, BfTypeDef* checkTypeDef);
void FinishTypeDef(bool wantsToString); void FinishTypeDef(bool wantsToString);

View file

@ -9520,7 +9520,7 @@ BfType* BfModule::ResolveGenericType(BfType* unspecializedType, BfTypeVector* ty
if (typeDef->mIsDelegate) if (typeDef->mIsDelegate)
{ {
BfDefBuilder::AddMethod(typeDef, BfMethodType_Ctor, BfProtection_Public, false, ""); BfDefBuilder::AddMethod(typeDef, BfMethodType_Ctor, BfProtection_Public, false, "");
BfDefBuilder::AddDynamicCastMethods(typeDef); BfDefBuilder::AddDynamicCastMethods(typeDef, true);
} }
delegateType->mContext = mContext; delegateType->mContext = mContext;
@ -12907,7 +12907,7 @@ BfType* BfModule::ResolveTypeRef_Ref(BfTypeReference* typeRef, BfPopulateType po
if (typeDef->mIsDelegate) if (typeDef->mIsDelegate)
{ {
BfDefBuilder::AddMethod(typeDef, BfMethodType_Ctor, BfProtection_Public, false, ""); BfDefBuilder::AddMethod(typeDef, BfMethodType_Ctor, BfProtection_Public, false, "");
BfDefBuilder::AddDynamicCastMethods(typeDef); BfDefBuilder::AddDynamicCastMethods(typeDef, true);
} }
delegateType->mContext = mContext; delegateType->mContext = mContext;