|
@@ -292,7 +292,8 @@ implementation
|
|
|
current_tokenpos:=tprocdef(pd).fileinfo;
|
|
|
|
|
|
{ Generate VMT variable for constructor/destructor }
|
|
|
- if (pd.proctypeoption in [potype_constructor,potype_destructor]) and not(is_cppclass(tprocdef(pd).struct)) then
|
|
|
+ if (pd.proctypeoption in [potype_constructor,potype_destructor]) and
|
|
|
+ not(is_cppclass(tprocdef(pd).struct) or is_record(tprocdef(pd).struct)) then
|
|
|
begin
|
|
|
{ can't use classrefdef as type because inheriting
|
|
|
will then always file because of a type mismatch }
|
|
@@ -313,7 +314,10 @@ implementation
|
|
|
vsp:=vs_var;
|
|
|
hdef:=tprocdef(pd).struct;
|
|
|
end;
|
|
|
- vs:=tparavarsym.create('$self',paranr_self,vsp,hdef,[vo_is_self,vo_is_hidden_para]);
|
|
|
+ if is_record(tprocdef(pd).struct) and (pd.proctypeoption=potype_constructor) then
|
|
|
+ vs:=tparavarsym.create('$self',paranr_self,vs_value,hdef,[vo_is_self,vo_is_hidden_para,vo_is_funcret])
|
|
|
+ else
|
|
|
+ vs:=tparavarsym.create('$self',paranr_self,vsp,hdef,[vo_is_self,vo_is_hidden_para]);
|
|
|
pd.parast.insert(vs);
|
|
|
|
|
|
current_tokenpos:=storepos;
|