mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-19 23:11:48 +02:00
* fixed constructor call in class methods
This commit is contained in:
parent
46acf4e809
commit
8fcfcc6606
@ -1785,7 +1785,13 @@ type
|
|||||||
{ do not create/destroy when called from member function
|
{ do not create/destroy when called from member function
|
||||||
without specifying self explicit }
|
without specifying self explicit }
|
||||||
if (nf_member_call in flags) then
|
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
|
else
|
||||||
{ constructor with extended syntax called from new }
|
{ constructor with extended syntax called from new }
|
||||||
if (nf_new_call in flags) then
|
if (nf_new_call in flags) then
|
||||||
@ -2609,7 +2615,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
* set_varstate cleanup
|
||||||
|
|
||||||
Revision 1.192 2003/10/07 21:14:32 peter
|
Revision 1.192 2003/10/07 21:14:32 peter
|
||||||
|
@ -1374,8 +1374,9 @@ implementation
|
|||||||
if possible_error then
|
if possible_error then
|
||||||
begin
|
begin
|
||||||
do_resulttypepass(p1);
|
do_resulttypepass(p1);
|
||||||
if not(po_classmethod in tcallnode(p1).procdefinition.procoptions) then
|
if not(tcallnode(p1).procdefinition.proctypeoption=potype_constructor) and
|
||||||
Message(parser_e_only_class_methods);
|
not(po_classmethod in tcallnode(p1).procdefinition.procoptions) then
|
||||||
|
Message(parser_e_only_class_methods);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2417,7 +2418,10 @@ implementation
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$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
|
* set_varstate cleanup
|
||||||
|
|
||||||
Revision 1.132 2003/10/05 12:56:04 peter
|
Revision 1.132 2003/10/05 12:56:04 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user