mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 22:47:59 +02: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;
|
||||
locationstr: string;
|
||||
old_parse_generic,
|
||||
popclass : boolean;
|
||||
popclass: boolean;
|
||||
old_current_objectdef: tobjectdef;
|
||||
begin
|
||||
locationstr:='';
|
||||
pd:=nil;
|
||||
@ -1016,10 +1017,15 @@ implementation
|
||||
symtablestack.push(pd._class.symtable);
|
||||
popclass:=true;
|
||||
parse_generic:=(df_generic in pd._class.defoptions);
|
||||
old_current_objectdef:=current_objectdef;
|
||||
current_objectdef:=pd._class;
|
||||
end;
|
||||
single_type(pd.returndef,false,false);
|
||||
if popclass then
|
||||
symtablestack.pop(pd._class.symtable);
|
||||
begin
|
||||
current_objectdef:=old_current_objectdef;
|
||||
symtablestack.pop(pd._class.symtable);
|
||||
end;
|
||||
dec(testcurobject);
|
||||
parse_generic:=old_parse_generic;
|
||||
|
||||
|
@ -15,6 +15,7 @@ type
|
||||
FPrivateField: PrivateType;
|
||||
public
|
||||
procedure DoSomething(Value: PrivateType = PrivateConst);
|
||||
function ReturnSomething: PrivateType;
|
||||
property SomeProp: PrivateType read FPrivateField write FPrivateField default PrivateConst;
|
||||
end;
|
||||
|
||||
@ -22,5 +23,10 @@ type
|
||||
begin
|
||||
end;
|
||||
|
||||
function TSomeClass.ReturnSomething: PrivateType;
|
||||
begin
|
||||
Result := PrivateConst;
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user