From: Jürg Billeter Date: Mon, 15 Dec 2008 08:30:07 +0000 (+0000) Subject: Fix constructors in inner structs X-Git-Tag: VALA_0_5_3~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c73a91a82fc98d7480d8ec993755c1888de17f2;p=thirdparty%2Fvala.git Fix constructors in inner structs 2008-12-15 Jürg Billeter * gobject/valaccodemethodmodule.vala: Fix constructors in inner structs svn path=/trunk/; revision=2152 --- diff --git a/ChangeLog b/ChangeLog index 30c69d03e..8933bead2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-15 Jürg Billeter + + * gobject/valaccodemethodmodule.vala: + + Fix constructors in inner structs + 2008-12-15 Jürg Billeter * vala/valastruct.vala: diff --git a/gobject/valaccodemethodmodule.vala b/gobject/valaccodemethodmodule.vala index 8e98f016e..459cb4e01 100644 --- a/gobject/valaccodemethodmodule.vala +++ b/gobject/valaccodemethodmodule.vala @@ -846,13 +846,13 @@ public class Vala.CCodeMethodModule : CCodeStructModule { head.visit_method (m); DataType creturn_type; - if (current_class != null) { + if (current_type_symbol is Class) { creturn_type = new ObjectType (current_class); } else { creturn_type = new VoidType (); } - if (current_class != null && !current_class.is_compact) { + if (current_type_symbol is Class && !current_class.is_compact) { var vfunc = new CCodeFunction (m.get_cname (), creturn_type.get_cname ()); vfunc.line = function.line; @@ -881,7 +881,7 @@ public class Vala.CCodeMethodModule : CCodeStructModule { source_type_member_definition.append (vfunc); } - if (current_class != null && current_class.is_subtype_of (gobject_type) + if (current_type_symbol is Class && current_class.is_subtype_of (gobject_type) && (((CreationMethod) m).n_construction_params > 0 || current_class.get_type_parameters ().size > 0)) { var ccond = new CCodeBinaryExpression (CCodeBinaryOperator.GREATER_THAN, new CCodeIdentifier ("__params_it"), new CCodeIdentifier ("__params")); var cdofreeparam = new CCodeBlock ();