From b6a3d662241853e1c06d2dd2a63ff863777a0e64 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Fri, 18 Aug 2017 15:27:47 +0000 Subject: [PATCH] * adjust check for non-static class methods in class helpers in so far that only classes allow such methods (interfaces and objects would not either) git-svn-id: trunk@36937 - --- compiler/pdecobj.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/pdecobj.pas b/compiler/pdecobj.pas index 4be4beb5b0..93198c9a62 100644 --- a/compiler/pdecobj.pas +++ b/compiler/pdecobj.pas @@ -907,7 +907,10 @@ implementation { for record and type helpers only static class methods are allowed } if is_objectpascal_helper(astruct) and - (tobjectdef(astruct).extendeddef.typ<>objectdef) and + ( + (tobjectdef(astruct).extendeddef.typ<>objectdef) or + (tobjectdef(tobjectdef(astruct).extendeddef).objecttype<>odt_class) + ) and is_classdef and not (po_staticmethod in result.procoptions) then MessagePos(result.fileinfo,parser_e_class_methods_only_static_in_records);