inherit integer_type and floating_type, fixes bug 530600
authorJuerg Billeter <j@bitron.ch>
Fri, 2 May 2008 21:03:36 +0000 (21:03 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Fri, 2 May 2008 21:03:36 +0000 (21:03 +0000)
2008-05-02  Juerg Billeter  <j@bitron.ch>

* vala/valastruct.vala: inherit integer_type and floating_type,
fixes bug 530600

svn path=/trunk/; revision=1337

ChangeLog
vala/valastruct.vala

index 27e3a0e..54d9e14 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-05-02  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valastruct.vala: inherit integer_type and floating_type,
+       fixes bug 530600
+
+2008-05-02  Jürg Billeter  <j@bitron.ch>
+
        * vala/valaarraytype.vala:
        * vala/valadatatype.vala:
        * gobject/valaccodegeneratorsignal.vala:
index 36794b6..49b9a62 100644 (file)
@@ -234,6 +234,12 @@ public class Vala.Struct : Typesymbol {
         * @return true if this is an integer type, false otherwise
         */
        public bool is_integer_type () {
+               foreach (DataType type in base_types) {
+                       var st = type.data_type as Struct;
+                       if (st != null && st.is_integer_type ()) {
+                               return true;
+                       }
+               }
                return integer_type;
        }
        
@@ -243,6 +249,12 @@ public class Vala.Struct : Typesymbol {
         * @return true if this is a floating point type, false otherwise
         */
        public bool is_floating_type () {
+               foreach (DataType type in base_types) {
+                       var st = type.data_type as Struct;
+                       if (st != null && st.is_floating_type ()) {
+                               return true;
+                       }
+               }
                return floating_type;
        }