mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-28 12:43:41 +01:00
compiler: fix internal class symbol search for function result + test
git-svn-id: trunk@14612 -
This commit is contained in:
parent
67ce65eb35
commit
4afb3ca971
@ -990,7 +990,8 @@ implementation
|
|||||||
pd : tprocdef;
|
pd : tprocdef;
|
||||||
locationstr: string;
|
locationstr: string;
|
||||||
old_parse_generic,
|
old_parse_generic,
|
||||||
popclass : boolean;
|
popclass: boolean;
|
||||||
|
old_current_objectdef: tobjectdef;
|
||||||
begin
|
begin
|
||||||
locationstr:='';
|
locationstr:='';
|
||||||
pd:=nil;
|
pd:=nil;
|
||||||
@ -1016,10 +1017,15 @@ implementation
|
|||||||
symtablestack.push(pd._class.symtable);
|
symtablestack.push(pd._class.symtable);
|
||||||
popclass:=true;
|
popclass:=true;
|
||||||
parse_generic:=(df_generic in pd._class.defoptions);
|
parse_generic:=(df_generic in pd._class.defoptions);
|
||||||
|
old_current_objectdef:=current_objectdef;
|
||||||
|
current_objectdef:=pd._class;
|
||||||
end;
|
end;
|
||||||
single_type(pd.returndef,false,false);
|
single_type(pd.returndef,false,false);
|
||||||
if popclass then
|
if popclass then
|
||||||
symtablestack.pop(pd._class.symtable);
|
begin
|
||||||
|
current_objectdef:=old_current_objectdef;
|
||||||
|
symtablestack.pop(pd._class.symtable);
|
||||||
|
end;
|
||||||
dec(testcurobject);
|
dec(testcurobject);
|
||||||
parse_generic:=old_parse_generic;
|
parse_generic:=old_parse_generic;
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ type
|
|||||||
FPrivateField: PrivateType;
|
FPrivateField: PrivateType;
|
||||||
public
|
public
|
||||||
procedure DoSomething(Value: PrivateType = PrivateConst);
|
procedure DoSomething(Value: PrivateType = PrivateConst);
|
||||||
|
function ReturnSomething: PrivateType;
|
||||||
property SomeProp: PrivateType read FPrivateField write FPrivateField default PrivateConst;
|
property SomeProp: PrivateType read FPrivateField write FPrivateField default PrivateConst;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -22,5 +23,10 @@ type
|
|||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSomeClass.ReturnSomething: PrivateType;
|
||||||
|
begin
|
||||||
|
Result := PrivateConst;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
end.
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user