]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix declaration order of classes and field types
authorJürg Billeter <j@bitron.ch>
Sun, 5 Apr 2009 20:22:46 +0000 (22:22 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 5 Apr 2009 20:22:46 +0000 (22:22 +0200)
gobject/valagobjectmodule.vala

index 521430769661a580f4f3eeef7d671930ecf072a5..d6904ee80fbfa2621a35cb73c632b6842df3aaf4 100644 (file)
@@ -204,15 +204,6 @@ internal class Vala.GObjectModule : GTypeModule {
                        }
                }
 
-               if (cl.source_reference.comment != null) {
-                       decl_space.add_type_definition (new CCodeComment (cl.source_reference.comment));
-               }
-               decl_space.add_type_definition (instance_struct);
-
-               if (is_gtypeinstance) {
-                       decl_space.add_type_definition (type_struct);
-               }
-
                foreach (Method m in cl.get_methods ()) {
                        generate_virtual_method_declaration (m, decl_space, type_struct);
                }
@@ -292,6 +283,15 @@ internal class Vala.GObjectModule : GTypeModule {
                                type_struct.add_field (field_ctype, f.get_cname ());
                        }
                }
+
+               if (cl.source_reference.comment != null) {
+                       decl_space.add_type_definition (new CCodeComment (cl.source_reference.comment));
+               }
+               decl_space.add_type_definition (instance_struct);
+
+               if (is_gtypeinstance) {
+                       decl_space.add_type_definition (type_struct);
+               }
        }
 
        public virtual void generate_virtual_method_declaration (Method m, CCodeDeclarationSpace decl_space, CCodeStruct type_struct) {