]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Also drop dynamic error warning from constructors
authorJürg Billeter <j@bitron.ch>
Sun, 13 Sep 2009 19:51:55 +0000 (21:51 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 13 Sep 2009 19:51:55 +0000 (21:51 +0200)
vala/valaconstructor.vala
vala/valacreationmethod.vala

index a09027a75c1235d595381cfbd15e82615a55ba2d..f61f3983171d9098f81559040a3172320eb84f91 100644 (file)
@@ -1,6 +1,6 @@
 /* valaconstructor.vala
  *
- * Copyright (C) 2006-2008  Jürg Billeter
+ * Copyright (C) 2006-2009  Jürg Billeter
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -79,7 +79,9 @@ public class Vala.Constructor : Symbol {
                }
 
                foreach (DataType body_error_type in body.get_error_types ()) {
-                       Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
+                       if (!((ErrorType) body_error_type).dynamic_error) {
+                               Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
+                       }
                }
 
                analyzer.current_symbol = analyzer.current_symbol.parent_symbol;
index 79cfa8eb07c41fa3ed5a7b17c2fab93b35b424bd..8469e1778240e5340861c250d1eba0a86a75a02d 100644 (file)
@@ -220,7 +220,7 @@ public class Vala.CreationMethod : Method {
                                                can_propagate_error = true;
                                        }
                                }
-                               if (!can_propagate_error) {
+                               if (!can_propagate_error && !((ErrorType) body_error_type).dynamic_error) {
                                        Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
                                }
                        }