mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-05 00:12:13 +01:00
* fix for Mantis #27349: nested classes might also reside inside records
+ added test git-svn-id: trunk@34714 -
This commit is contained in:
parent
254be82c43
commit
d4e573c1e3
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
43
tests/webtbs/tw27349.pp
Normal file
43
tests/webtbs/tw27349.pp
Normal file
@ -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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user