]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Add GError parameter for overriding methods where necessary
authorJürg Billeter <j@bitron.ch>
Mon, 27 Jul 2009 17:15:31 +0000 (19:15 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 27 Jul 2009 17:15:31 +0000 (19:15 +0200)
Check the error types of the base method as well, fixes bug 548283.

codegen/valaccodemethodmodule.vala
vala/valamethod.vala

index 36ec07888f959b06b9f9335703477239d3d0ba78..eb73b0f7ae2ce08a8935b9c75ae8eaa6e8e6ec2d 100644 (file)
@@ -104,7 +104,7 @@ internal class Vala.CCodeMethodModule : CCodeStructModule {
                        }
                }
 
-               if (m.get_error_types ().size > 0) {
+               if (m.get_error_types ().size > 0 || (m.base_method != null && m.base_method.get_error_types ().size > 0)) {
                        foreach (DataType error_type in m.get_error_types ()) {
                                generate_type_declaration (error_type, decl_space);
                        }
index 5acfc655b72c29305f8f38f4297e35f00c52c60a..5fa7dd08bde2ac41794ba25beb6a668aa6769cfe 100644 (file)
@@ -453,7 +453,7 @@ public class Vala.Method : Member {
                        return false;
                }
 
-               /* this method may throw more but not less errors than the base method */
+               /* this method may throw less but not more errors than the base method */
                foreach (DataType method_error_type in get_error_types ()) {
                        bool match = false;
                        foreach (DataType base_method_error_type in base_method.get_error_types ()) {