+2009-02-17 Jürg Billeter <j@bitron.ch>
+
+ * gobject/valaccodemethodcallmodule.vala:
+
+ Support chaining up to constructors in generic classes,
+ fixes bug 567319
+
2009-02-17 Ali Sabil <ali.sabil@gmail.com>
* vapigen/valagidlparser.vala:
if (m is CreationMethod) {
ccall.add_argument (new CCodeIdentifier ("object_type"));
+
+ foreach (DataType base_type in current_class.get_base_types ()) {
+ if (base_type.data_type is Class) {
+ foreach (DataType type_arg in base_type.get_type_arguments ()) {
+ if (type_arg is GenericType) {
+ // map generic type parameter
+ string type_param = type_arg.type_parameter.name.down ();
+ ccall.add_argument (new CCodeIdentifier ("%s_type".printf (type_param)));
+ ccall.add_argument (new CCodeIdentifier ("%s_dup_func".printf (type_param)));
+ ccall.add_argument (new CCodeIdentifier ("%s_destroy_func".printf (type_param)));
+ } else {
+ ccall.add_argument (new CCodeIdentifier (type_arg.get_type_id ()));
+ if (requires_copy (type_arg)) {
+ var dup_func = get_dup_func_expression (type_arg, type_arg.source_reference);
+ if (dup_func == null) {
+ // type doesn't contain a copy function
+ expr.error = true;
+ return;
+ }
+ ccall.add_argument (new CCodeCastExpression (dup_func, "GBoxedCopyFunc"));
+ ccall.add_argument (get_destroy_func_expression (type_arg));
+ } else {
+ ccall.add_argument (new CCodeConstant ("NULL"));
+ ccall.add_argument (new CCodeConstant ("NULL"));
+ }
+ }
+ }
+
+ break;
+ }
+ }
}
// the complete call expression, might include casts, comma expressions, and/or assignments