]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Inherit array_length and array_null_terminated of methods
authorLuca Bruno <lucabru@src.gnome.org>
Thu, 20 Mar 2014 19:28:33 +0000 (20:28 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Thu, 20 Mar 2014 21:27:05 +0000 (22:27 +0100)
Fixes bug 726744

codegen/valaccodeattribute.vala

index 05745df0cfaeb2dae2ed9f94f252c38f9522bb7e..ce1dcc78366d12b2c1e87796ec903db5b51d2168 100644 (file)
@@ -1303,6 +1303,13 @@ public class Vala.CCodeAttribute : AttributeCache {
                        if (param.base_parameter != null) {
                                return CCodeBaseModule.get_ccode_array_length (param.base_parameter);
                        }
+               } else if (node is Method) {
+                       var method = (Method) node;
+                       if (method.base_method != null && method.base_method != method) {
+                               return CCodeBaseModule.get_ccode_array_length (method.base_method);
+                       } else if (method.base_interface_method != null && method.base_interface_method != method) {
+                               return CCodeBaseModule.get_ccode_array_length (method.base_interface_method);
+                       }
                }
                return true;
        }
@@ -1313,6 +1320,13 @@ public class Vala.CCodeAttribute : AttributeCache {
                        if (param.base_parameter != null) {
                                return CCodeBaseModule.get_ccode_array_null_terminated (param.base_parameter);
                        }
+               } else if (node is Method) {
+                       var method = (Method) node;
+                       if (method.base_method != null && method.base_method != method) {
+                               return CCodeBaseModule.get_ccode_array_null_terminated (method.base_method);
+                       } else if (method.base_interface_method != null && method.base_interface_method != method) {
+                               return CCodeBaseModule.get_ccode_array_null_terminated (method.base_interface_method);
+                       }
                }
                return false;
        }