mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-10 12:58:12 +02:00
Fix for Mantis #25210 .
compiler/pdecobj.pas, object_dec: * since revision 25518 the global symtable of the current module is no longer popped and pushed again so that the defaware symtablestack can add the helper; thus we need to do this not only for static symtables, but for global ones as well * adjusted comment to reflect current situation git-svn-id: trunk@25834 -
This commit is contained in:
parent
1f30cd9505
commit
d91d4afb0f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -13624,6 +13624,7 @@ tests/webtbs/tw25081.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw25101.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2514.pp svneol=native#text/plain
|
||||
tests/webtbs/tw25198.pp svneol=native#text/plain
|
||||
tests/webtbs/tw25210.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2525.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2536.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2540.pp svneol=native#text/plain
|
||||
|
@ -1565,9 +1565,9 @@ implementation
|
||||
else if is_objcclass(current_structdef) then
|
||||
setobjcclassmethodoptions;
|
||||
|
||||
{ if this helper is defined in the implementation section of the unit
|
||||
or inside the main project file, the extendeddefs list of the current
|
||||
module must be updated (it will be removed when poping the symtable) }
|
||||
{ we need to add this helper to the extendeddefs of the current module,
|
||||
as the global and static symtable are not pushed onto the symtable
|
||||
stack again (it will be removed when poping the symtable) }
|
||||
if is_objectpascal_helper(current_structdef) and
|
||||
(current_objectdef.extendeddef.typ<>errordef) then
|
||||
begin
|
||||
@ -1575,7 +1575,7 @@ implementation
|
||||
st:=current_structdef.owner;
|
||||
while st.symtabletype in [objectsymtable,recordsymtable] do
|
||||
st:=st.defowner.owner;
|
||||
if st.symtabletype=staticsymtable then
|
||||
if st.symtabletype in [staticsymtable,globalsymtable] then
|
||||
begin
|
||||
if current_objectdef.extendeddef.typ in [recorddef,objectdef] then
|
||||
s:=make_mangledname('',tabstractrecorddef(current_objectdef.extendeddef).symtable,'')
|
||||
|
28
tests/webtbs/tw25210.pp
Normal file
28
tests/webtbs/tw25210.pp
Normal file
@ -0,0 +1,28 @@
|
||||
unit tw25210;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes;
|
||||
|
||||
type
|
||||
TStringsHelper = class helper for TStrings
|
||||
procedure Test;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
procedure TStringsHelper.Test;
|
||||
begin
|
||||
Writeln('Foobar');
|
||||
end;
|
||||
|
||||
var
|
||||
s: TStrings;
|
||||
initialization
|
||||
s := TStringList.Create;
|
||||
s.Test;
|
||||
s.Free;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user