diff --git a/.gitattributes b/.gitattributes index b8c8803136..63dcdfaa44 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15029,6 +15029,7 @@ tests/webtbs/tw27300a.pp svneol=native#text/pascal tests/webtbs/tw2731.pp svneol=native#text/plain tests/webtbs/tw27320.pp svneol=native#text/pascal tests/webtbs/tw27348.pp svneol=native#text/pascal +tests/webtbs/tw27349.pp svneol=native#text/pascal tests/webtbs/tw2736.pp svneol=native#text/plain tests/webtbs/tw2737.pp svneol=native#text/plain tests/webtbs/tw2738.pp svneol=native#text/plain diff --git a/compiler/symtable.pas b/compiler/symtable.pas index 3a46c8bdab..be288234c5 100644 --- a/compiler/symtable.pas +++ b/compiler/symtable.pas @@ -2956,7 +2956,7 @@ implementation ) or ( assigned(contextobjdef) and - (contextobjdef.owner.symtabletype in [globalsymtable,staticsymtable,ObjectSymtable]) and + (contextobjdef.owner.symtabletype in [globalsymtable,staticsymtable,ObjectSymtable,recordsymtable]) and (contextobjdef.owner.iscurrentunit) and def_is_related(contextobjdef,symownerdef) ) or diff --git a/tests/webtbs/tw27349.pp b/tests/webtbs/tw27349.pp new file mode 100644 index 0000000000..3800976725 --- /dev/null +++ b/tests/webtbs/tw27349.pp @@ -0,0 +1,43 @@ +{ %NORUN } + +program tw27349; + +{$mode delphi} +{.$mode objfpc} +{.$modeswitch advancedrecords} + +type + + C = class + + type + + tmyintf = class(TInterfacedObject, iinterface) + function _AddRef : longint; stdcall; + end; + + end; + + R = record + + type + + tmyintf = class(TInterfacedObject, iinterface) + function _AddRef : longint; stdcall; + end; + + end; + +function C.tmyintf._AddRef: longint; stdcall; +begin + result := inherited _AddRef; // OK +end; + +function R.tmyintf._AddRef: longint; stdcall; +begin + result := inherited _AddRef; // FAIL +end; + +begin +end. +