mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Removed mDtorDef, fixed MethodSpecializationRequest on emitted method
This commit is contained in:
parent
71d4dd0e90
commit
bc8758bbac
7 changed files with 71 additions and 51 deletions
|
@ -3933,9 +3933,17 @@ void BfModule::Visit(BfDeleteStatement* deleteStmt)
|
|||
while (checkTypeInst != NULL)
|
||||
{
|
||||
auto checkTypeDef = checkTypeInst->mTypeDef;
|
||||
if (checkTypeDef->mDtorDef != NULL)
|
||||
|
||||
checkTypeDef->PopulateMemberSets();
|
||||
BfMemberSetEntry* entry = NULL;
|
||||
BfMethodDef* dtorMethodDef = NULL;
|
||||
checkTypeDef->mMethodSet.TryGetWith(String("~this"), &entry);
|
||||
if (entry != NULL)
|
||||
dtorMethodDef = (BfMethodDef*)entry->mMemberDef;
|
||||
|
||||
if (dtorMethodDef)
|
||||
{
|
||||
if (!CheckProtection(checkTypeDef->mDtorDef->mProtection, checkTypeInst->mTypeDef, allowProtected, allowPrivate))
|
||||
if (!CheckProtection(dtorMethodDef->mProtection, checkTypeInst->mTypeDef, allowProtected, allowPrivate))
|
||||
{
|
||||
auto error = Fail(StrFormat("'%s.~this()' is inaccessible due to its protection level", TypeToString(checkTypeInst).c_str()), deleteStmt->mExpression); // CS0122
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue