[vala/1270-remove-static-codecontext-access] Symbol.add_interface(): avoid use static context



commit 591f12d8514d8bc6630214a53f94289eb6587e63
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Dec 29 18:31:53 2021 -0600

    Symbol.add_interface(): avoid use static context

 vala/valagenieparser.vala      | 4 ++--
 vala/valagirparser.vala        | 2 +-
 vala/valanamespace.vala        | 4 ++--
 vala/valaobjecttypesymbol.vala | 2 +-
 vala/valaparser.vala           | 2 +-
 vala/valasymbol.vala           | 4 ++--
 vapigen/valagidlparser.vala    | 2 +-
 7 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index 103ecb976..ec60f4f19 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -2602,7 +2602,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                } else if (sym is Class) {
                        ns.add_class ((Class) sym, context);
                } else if (sym is Interface) {
-                       ns.add_interface ((Interface) sym);
+                       ns.add_interface ((Interface) sym, context);
                } else if (sym is Struct) {
                        ns.add_struct ((Struct) sym);
                } else if (sym is Enum) {
@@ -3399,7 +3399,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                        if (result is Namespace) {
                                ns.add_namespace ((Namespace) result, context);
                        } else {
-                               ns.add_interface ((Interface) result);
+                               ns.add_interface ((Interface) result, context);
                        }
                        result = ns;
                }
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index bb3038e14..cb99cd53e 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1607,7 +1607,7 @@ public class Vala.GirParser : CodeVisitor {
                                }
                                ns.add_field (field);
                        } else if (sym is Interface) {
-                               ns.add_interface ((Interface) sym);
+                               ns.add_interface ((Interface) sym, context);
                        } else if (sym is Method) {
                                unowned Method method = (Method) sym;
                                if (method.binding == MemberBinding.INSTANCE) {
diff --git a/vala/valanamespace.vala b/vala/valanamespace.vala
index 543bd2d25..b1068e0b7 100644
--- a/vala/valanamespace.vala
+++ b/vala/valanamespace.vala
@@ -106,7 +106,7 @@ public class Vala.Namespace : Symbol {
                                old_ns.add_struct (st);
                        }
                        foreach (Interface iface in ns.get_interfaces ()) {
-                               old_ns.add_interface (iface);
+                               old_ns.add_interface (iface, context);
                        }
                        foreach (Delegate d in ns.get_delegates ()) {
                                old_ns.add_delegate (d);
@@ -173,7 +173,7 @@ public class Vala.Namespace : Symbol {
         *
         * @param iface an interface
         */
-       public override void add_interface (Interface iface) {
+       public override void add_interface (Interface iface, CodeContext context) {
                // namespaces do not support private members
                if (iface.access == SymbolAccessibility.PRIVATE) {
                        iface.access = SymbolAccessibility.INTERNAL;
diff --git a/vala/valaobjecttypesymbol.vala b/vala/valaobjecttypesymbol.vala
index dfa42d407..764b3c61f 100644
--- a/vala/valaobjecttypesymbol.vala
+++ b/vala/valaobjecttypesymbol.vala
@@ -208,7 +208,7 @@ public abstract class Vala.ObjectTypeSymbol : TypeSymbol {
         *
         * @param iface an interface
         */
-       public override void add_interface (Interface iface) {
+       public override void add_interface (Interface iface, CodeContext context) {
                interfaces.add (iface);
                scope.add (iface.name, iface);
        }
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index eda1f0f8d..f6820f8a8 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -3544,7 +3544,7 @@ public class Vala.Parser : CodeVisitor {
                        if (result is Namespace) {
                                next.add_namespace ((Namespace) result, context);
                        } else {
-                               next.add_interface ((Interface) result);
+                               next.add_interface ((Interface) result, context);
                        }
                        result = next;
                }
diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala
index ed3a7dc35..32fb2e48b 100644
--- a/vala/valasymbol.vala
+++ b/vala/valasymbol.vala
@@ -459,8 +459,8 @@ public abstract class Vala.Symbol : CodeNode {
                context.report.log_error (cl.source_reference, "inner `%s' types are not supported in `%s'", 
"class", get_full_name ());
        }
 
-       public virtual void add_interface (Interface iface) {
-               Report.error (iface.source_reference, "inner `%s' types are not supported in `%s'", 
"interface", get_full_name ());
+       public virtual void add_interface (Interface iface, CodeContext context) {
+               context.report.log_error (iface.source_reference, "inner `%s' types are not supported in 
`%s'", "interface", get_full_name ());
        }
 
        public virtual void add_struct (Struct st) {
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 4b0da7678..f5cb40f45 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -390,7 +390,7 @@ public class Vala.GIdlParser : CodeVisitor {
                                }
                                ns.add_field (field);
                        } else if (sym is Interface) {
-                               ns.add_interface ((Interface) sym);
+                               ns.add_interface ((Interface) sym, context);
                        } else if (sym is Method) {
                                unowned Method method = (Method) sym;
                                if (method.binding == MemberBinding.INSTANCE) {


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