From 587f91fcceccb7fc75b96dcdb25a4751d4350159 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 30 Oct 2020 13:20:54 -0700 Subject: [PATCH] Fixed interface error with private property accessors --- IDEHelper/Compiler/BfModule.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index f68d4d6c..f4521f6f 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -22416,7 +22416,13 @@ bool BfModule::SlotInterfaceMethod(BfMethodInstance* methodInstance) if ((methodDef->mBody == NULL) && (methodDef->mProtection == BfProtection_Private)) { - Fail("Private interface methods must provide a body", methodDef->GetMethodDeclaration()->mProtectionSpecifier); + auto methodDeclaration = methodDef->GetMethodDeclaration(); + BfAstNode* refNode = NULL; + if (auto propertyDeclaration = methodDef->GetPropertyDeclaration()) + refNode = propertyDeclaration->mProtectionSpecifier; + else if (methodDeclaration != NULL) + refNode = methodDeclaration->mProtectionSpecifier; + Fail("Private interface methods must provide a body", refNode); } if ((methodInstance->mMethodInfoEx != NULL) && (methodInstance->mMethodInfoEx->mExplicitInterface != NULL) && (!methodDef->mIsOverride))