Support duplicating errors
authorJürg Billeter <j@bitron.ch>
Tue, 17 Jun 2008 20:26:44 +0000 (20:26 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Tue, 17 Jun 2008 20:26:44 +0000 (20:26 +0000)
2008-06-17  Jürg Billeter  <j@bitron.ch>

* gobject/valaccodegenerator.vala:

Support duplicating errors

svn path=/trunk/; revision=1609

ChangeLog
gobject/valaccodegenerator.vala

index 3b44201..0b692b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-06-17  Jürg Billeter  <j@bitron.ch>
 
+       * gobject/valaccodegenerator.vala:
+
+       Support duplicating errors
+
+2008-06-17  Jürg Billeter  <j@bitron.ch>
+
        * vala/valasymbol.vala:
        * gobject/valaccodeobjecttypesymbolbinding.vala:
 
index 91890ef..7276072 100644 (file)
@@ -1280,7 +1280,9 @@ public class Vala.CCodeGenerator : CodeGenerator {
 
        public CCodeExpression? get_dup_func_expression (DataType type, SourceReference? source_reference) {
                var cl = type.data_type as Class;
-               if (type.data_type != null) {
+               if (type is ErrorType) {
+                       return new CCodeIdentifier ("g_error_copy");
+               } else if (type.data_type != null) {
                        string dup_function;
                        if (type.data_type.is_reference_counting ()) {
                                dup_function = type.data_type.get_ref_function ();