* fixed constructor call in class methods

This commit is contained in:
florian 2003-10-09 15:00:13 +00:00
parent 46acf4e809
commit 8fcfcc6606
2 changed files with 18 additions and 5 deletions

View File

@ -1785,7 +1785,13 @@ type
{ do not create/destroy when called from member function
without specifying self explicit }
if (nf_member_call in flags) then
vmttree:=cpointerconstnode.create(0,voidpointertype)
begin
if (methodpointer.resulttype.def.deftype=classrefdef) and
(procdefinition.proctypeoption=potype_constructor) then
vmttree:=methodpointer.getcopy
else
vmttree:=cpointerconstnode.create(0,voidpointertype);
end
else
{ constructor with extended syntax called from new }
if (nf_new_call in flags) then
@ -2609,7 +2615,10 @@ begin
end.
{
$Log$
Revision 1.193 2003-10-08 19:19:45 peter
Revision 1.194 2003-10-09 15:00:13 florian
* fixed constructor call in class methods
Revision 1.193 2003/10/08 19:19:45 peter
* set_varstate cleanup
Revision 1.192 2003/10/07 21:14:32 peter

View File

@ -1374,8 +1374,9 @@ implementation
if possible_error then
begin
do_resulttypepass(p1);
if not(po_classmethod in tcallnode(p1).procdefinition.procoptions) then
Message(parser_e_only_class_methods);
if not(tcallnode(p1).procdefinition.proctypeoption=potype_constructor) and
not(po_classmethod in tcallnode(p1).procdefinition.procoptions) then
Message(parser_e_only_class_methods);
end;
end;
@ -2417,7 +2418,10 @@ implementation
end.
{
$Log$
Revision 1.133 2003-10-08 19:19:45 peter
Revision 1.134 2003-10-09 15:00:13 florian
* fixed constructor call in class methods
Revision 1.133 2003/10/08 19:19:45 peter
* set_varstate cleanup
Revision 1.132 2003/10/05 12:56:04 peter