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

Fixed dtor lookup

This commit is contained in:
Brian Fiete 2021-02-07 16:17:24 -08:00
parent eddbf7a984
commit 9268e3b25d
6 changed files with 73 additions and 37 deletions

View file

@ -3934,15 +3934,7 @@ void BfModule::Visit(BfDeleteStatement* deleteStmt)
bool allowProtected = allowPrivate || TypeIsSubTypeOf(mCurTypeInstance, checkTypeInst);
while (checkTypeInst != NULL)
{
auto checkTypeDef = checkTypeInst->mTypeDef;
checkTypeDef->PopulateMemberSets();
BfMemberSetEntry* entry = NULL;
BfMethodDef* dtorMethodDef = NULL;
checkTypeDef->mMethodSet.TryGetWith(String("~this"), &entry);
if (entry != NULL)
dtorMethodDef = (BfMethodDef*)entry->mMemberDef;
auto dtorMethodDef = checkTypeInst->mTypeDef->GetMethodByName("~this");
if (dtorMethodDef)
{
if (!CheckProtection(dtorMethodDef->mProtection, checkTypeInst->mTypeDef, allowProtected, allowPrivate))