[vala/staging: 3/7] gidl/girparser: Creation methods must not be marked as static



commit 626d3e63015a9ac303de3a9e72314b309a0ae123
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Nov 17 14:08:24 2019 +0100

    gidl/girparser: Creation methods must not be marked as static

 vala/valagirparser.vala     | 1 -
 vapigen/valagidlparser.vala | 8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 4213824b2..3f2025093 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -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;
 
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 5f956dbf8..82f4b12cc 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -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;
                }


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