]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gidl/girparser: Creation methods must not be marked as static
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 17 Nov 2019 13:08:24 +0000 (14:08 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 17 Nov 2019 13:11:55 +0000 (14:11 +0100)
vala/valagirparser.vala
vapigen/valagidlparser.vala

index 4213824b2a85c1a1ccc48cdf5f4f7ea103f1720c..3f2025093f67abff2d47e1b1e92c156338c5d0b8 100644 (file)
@@ -4180,7 +4180,6 @@ public class Vala.GirParser : CodeVisitor {
                        if (finish_method is CreationMethod) {
                                method = new CreationMethod (((CreationMethod) finish_method).class_name, null, m.source_reference);
                                method.access = m.access;
-                               method.binding = m.binding;
                                method.coroutine = true;
                                method.has_construct_function = finish_method.has_construct_function;
 
index 5f956dbf8e1ae507e20f337270c6383da47f3220..82f4b12cc53d9e6f42cae303f767d181a9d82823 100644 (file)
@@ -447,7 +447,9 @@ public class Vala.GIdlParser : CodeVisitor {
                } else if (node.type == IdlNodeTypeId.FUNCTION) {
                        var m = parse_function ((IdlNodeFunction) node);
                        if (m != null) {
-                               m.binding = MemberBinding.STATIC;
+                               if (!(m is CreationMethod)) {
+                                       m.binding = MemberBinding.STATIC;
+                               }
                                add_symbol_to_container (container, m);
                                current_source_file.add_node (m);
                        }
@@ -2404,7 +2406,7 @@ public class Vala.GIdlParser : CodeVisitor {
                                                m.name = m.name.substring ("class_".length, m.name.length - "class_".length);
                                        }
                                        continue;
-                               } else {
+                               } else if (!(m is CreationMethod)) {
                                        // static method
                                        m.binding = MemberBinding.STATIC;
                                }
@@ -2604,7 +2606,7 @@ public class Vala.GIdlParser : CodeVisitor {
                        }
                }
 
-               if (first) {
+               if (first && !(m is CreationMethod)) {
                        // no parameters => static method
                        m.binding = MemberBinding.STATIC;
                }