summaryrefslogtreecommitdiff
path: root/compiler/pdecobj.pas
diff options
context:
space:
mode:
authorsvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-06-12 09:42:22 +0000
committersvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-06-12 09:42:22 +0000
commit9d991b810a186fc632cf7828ab1870d11e70a2ca (patch)
tree2968eb1548898dbf3dc10bc5664a45acdf24b406 /compiler/pdecobj.pas
parentc5c9835c1129108efe507006d30a4b63112875ff (diff)
downloadfpc-9d991b810a186fc632cf7828ab1870d11e70a2ca.tar.gz
Fix for Mantis #21457
* pdecsub.pas, parse_proc_dec & pdecobj.pas, constructor_head: correctly set the return type of the constructor of a class helper to the extended def * psub.pas, generate_bodyentry_block: call the NEWINSTANCE of the extended class for constructors of class helpers git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21582 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/pdecobj.pas')
-rw-r--r--compiler/pdecobj.pas10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/pdecobj.pas b/compiler/pdecobj.pas
index 535f810c9a..2b59d5aace 100644
--- a/compiler/pdecobj.pas
+++ b/compiler/pdecobj.pas
@@ -133,16 +133,20 @@ implementation
consume(_SEMICOLON);
include(current_structdef.objectoptions,oo_has_constructor);
{ Set return type, class and record constructors return the
- created instance, object constructors return boolean }
+ created instance, helper types return the extended type,
+ object constructors return boolean }
if is_class(pd.struct) or
is_record(pd.struct) or
is_javaclass(pd.struct) then
pd.returndef:=pd.struct
else
+ if is_objectpascal_helper(pd.struct) then
+ pd.returndef:=tobjectdef(pd.struct).extendeddef
+ else
{$ifdef CPU64bitaddr}
- pd.returndef:=bool64type;
+ pd.returndef:=bool64type;
{$else CPU64bitaddr}
- pd.returndef:=bool32type;
+ pd.returndef:=bool32type;
{$endif CPU64bitaddr}
constr_destr_finish_head(pd,pd.struct);
result:=pd;