mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 23:59:31 +02:00
compiler: fix internal class symbol search for method arguments
git-svn-id: trunk@14610 -
This commit is contained in:
parent
166f8a63a2
commit
fd6e2cc86e
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8894,6 +8894,7 @@ tests/test/tclass11a.pp svneol=native#text/pascal
|
||||
tests/test/tclass11b.pp svneol=native#text/pascal
|
||||
tests/test/tclass12a.pp svneol=native#text/pascal
|
||||
tests/test/tclass12b.pp svneol=native#text/pascal
|
||||
tests/test/tclass12c.pp svneol=native#text/pascal
|
||||
tests/test/tclass2.pp svneol=native#text/plain
|
||||
tests/test/tclass3.pp svneol=native#text/plain
|
||||
tests/test/tclass4.pp svneol=native#text/plain
|
||||
|
@ -702,6 +702,7 @@ implementation
|
||||
popclass : boolean;
|
||||
ImplIntf : TImplementedInterface;
|
||||
old_parse_generic : boolean;
|
||||
old_current_objectdef: tobjectdef;
|
||||
begin
|
||||
{ Save the position where this procedure really starts }
|
||||
procstartfilepos:=current_tokenpos;
|
||||
@ -962,6 +963,8 @@ implementation
|
||||
(symtablestack.top.symtabletype<>ObjectSymtable) then
|
||||
begin
|
||||
symtablestack.push(pd._class.symtable);
|
||||
old_current_objectdef:=current_objectdef;
|
||||
current_objectdef:=pd._class;
|
||||
popclass:=true;
|
||||
end;
|
||||
{ Add parameter symtable }
|
||||
@ -971,7 +974,10 @@ implementation
|
||||
if pd.parast.symtabletype<>staticsymtable then
|
||||
symtablestack.pop(pd.parast);
|
||||
if popclass then
|
||||
begin
|
||||
current_objectdef:=old_current_objectdef;
|
||||
symtablestack.pop(pd._class.symtable);
|
||||
end;
|
||||
end;
|
||||
|
||||
parse_generic:=old_parse_generic;
|
||||
|
23
tests/test/tclass12c.pp
Normal file
23
tests/test/tclass12c.pp
Normal file
@ -0,0 +1,23 @@
|
||||
program tclass12c;
|
||||
{$ifdef fpc}
|
||||
{$mode delphi}
|
||||
{$endif}
|
||||
{$apptype console}
|
||||
|
||||
type
|
||||
TSomeClass = class
|
||||
strict private
|
||||
const
|
||||
PrivateConst = 1;
|
||||
type
|
||||
PrivateType = type Integer;
|
||||
public
|
||||
procedure DoSomething(Value: PrivateType = PrivateConst);
|
||||
end;
|
||||
|
||||
procedure TSomeClass.DoSomething(Value: PrivateType = PrivateConst);
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user