[vala] codegen: Inherit array_length and array_null_terminated of methods



commit 42393d7aacf98e0e1657aadebdc8d4961db7a447
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu Mar 20 20:28:33 2014 +0100

    codegen: Inherit array_length and array_null_terminated of methods
    
    Fixes bug 726744

 codegen/valaccodeattribute.vala |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodeattribute.vala b/codegen/valaccodeattribute.vala
index 05745df..ce1dcc7 100644
--- a/codegen/valaccodeattribute.vala
+++ b/codegen/valaccodeattribute.vala
@@ -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;
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]