From 9ba8bd86b8808e8e27ff1b3306f87ccd071cded4 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 22 Jun 2021 10:51:52 -0700 Subject: [PATCH] Fixed field dtor error in autoprops --- IDEHelper/Compiler/BfDefBuilder.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/IDEHelper/Compiler/BfDefBuilder.cpp b/IDEHelper/Compiler/BfDefBuilder.cpp index 80e17e20..07da63b0 100644 --- a/IDEHelper/Compiler/BfDefBuilder.cpp +++ b/IDEHelper/Compiler/BfDefBuilder.cpp @@ -965,10 +965,13 @@ void BfDefBuilder::Visit(BfPropertyDeclaration* propertyDeclaration) } else { - if (mCurTypeDef->mTypeCode == BfTypeCode_Interface) - Fail("Interface properties cannot have field destructors", propertyDeclaration->mFieldDtor); - else if (propertyDeclaration->mFieldDtor != NULL) - Fail("Properties with method bodies cannot have field destructors", propertyDeclaration->mFieldDtor); + if (propertyDeclaration->mFieldDtor != NULL) + { + if (mCurTypeDef->mTypeCode == BfTypeCode_Interface) + Fail("Interface properties cannot have field destructors", propertyDeclaration->mFieldDtor); + else + Fail("Properties with method bodies cannot have field destructors", propertyDeclaration->mFieldDtor); + } } for (auto methodDeclaration : propertyDeclaration->mMethods)