compiler: fix internal class symbol search for function result + test

git-svn-id: trunk@14612 -
This commit is contained in:
paul 2010-01-11 11:09:12 +00:00
parent 67ce65eb35
commit 4afb3ca971
2 changed files with 14 additions and 2 deletions

View File

@ -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;

View File

@ -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.