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



commit 01e84e52bcd90ea882e19f06ebc28b274929a17f
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Dec 29 20:06:08 2021 -0600

    Symbol.add_error_domain(): avoid static code context

 vala/valagenieparser.vala   | 4 ++--
 vala/valagirparser.vala     | 2 +-
 vala/valanamespace.vala     | 4 ++--
 vala/valaparser.vala        | 2 +-
 vala/valasymbol.vala        | 4 ++--
 vapigen/valagidlparser.vala | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index c5ea5d384..9ad9f8aef 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -2608,7 +2608,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                } else if (sym is Enum) {
                        ns.add_enum ((Enum) sym, context);
                } else if (sym is ErrorDomain) {
-                       ns.add_error_domain ((ErrorDomain) sym);
+                       ns.add_error_domain ((ErrorDomain) sym, context);
                } else if (sym is Delegate) {
                        ns.add_delegate ((Delegate) sym);
                } else if (sym is Method) {
@@ -3543,7 +3543,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                        if (result is Namespace) {
                                ns.add_namespace ((Namespace) result, context);
                        } else {
-                               ns.add_error_domain ((ErrorDomain) result);
+                               ns.add_error_domain ((ErrorDomain) result, context);
                        }
                        result = ns;
                }
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 74c4a59b9..85fea572f 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1599,7 +1599,7 @@ public class Vala.GirParser : CodeVisitor {
                        } else if (sym is Enum) {
                                ns.add_enum ((Enum) sym, context);
                        } else if (sym is ErrorDomain) {
-                               ns.add_error_domain ((ErrorDomain) sym);
+                               ns.add_error_domain ((ErrorDomain) sym, context);
                        } else if (sym is Field) {
                                unowned Field field = (Field) sym;
                                if (field.binding == MemberBinding.INSTANCE) {
diff --git a/vala/valanamespace.vala b/vala/valanamespace.vala
index 107832b3b..820356748 100644
--- a/vala/valanamespace.vala
+++ b/vala/valanamespace.vala
@@ -115,7 +115,7 @@ public class Vala.Namespace : Symbol {
                                old_ns.add_enum (en, context);
                        }
                        foreach (ErrorDomain ed in ns.get_error_domains ()) {
-                               old_ns.add_error_domain (ed);
+                               old_ns.add_error_domain (ed, context);
                        }
                        foreach (Constant c in ns.get_constants ()) {
                                old_ns.add_constant (c);
@@ -231,7 +231,7 @@ public class Vala.Namespace : Symbol {
         *
         * @param edomain an error domain
         */
-       public override void add_error_domain (ErrorDomain edomain) {
+       public override void add_error_domain (ErrorDomain edomain, CodeContext context) {
                // namespaces do not support private members
                if (edomain.access == SymbolAccessibility.PRIVATE) {
                        edomain.access = SymbolAccessibility.INTERNAL;
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index 962ea365d..2629990b3 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -3676,7 +3676,7 @@ public class Vala.Parser : CodeVisitor {
                        if (result is Namespace) {
                                next.add_namespace ((Namespace) result, context);
                        } else {
-                               next.add_error_domain ((ErrorDomain) result);
+                               next.add_error_domain ((ErrorDomain) result, context);
                        }
                        result = next;
                }
diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala
index a38f0094c..05e33e903 100644
--- a/vala/valasymbol.vala
+++ b/vala/valasymbol.vala
@@ -471,8 +471,8 @@ public abstract class Vala.Symbol : CodeNode {
                context.report.log_error (en.source_reference, "inner `%s' types are not supported in `%s'", 
"enum", get_full_name ());
        }
 
-       public virtual void add_error_domain (ErrorDomain edomain) {
-               Report.error (edomain.source_reference, "inner `%s' types are not supported in `%s'", 
"errordomain", get_full_name ());
+       public virtual void add_error_domain (ErrorDomain edomain, CodeContext context) {
+               context.report.log_error (edomain.source_reference, "inner `%s' types are not supported in 
`%s'", "errordomain", get_full_name ());
        }
 
        public virtual void add_delegate (Delegate d) {
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 3609afa47..93e71f07e 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -382,7 +382,7 @@ public class Vala.GIdlParser : CodeVisitor {
                        } else if (sym is Enum) {
                                ns.add_enum ((Enum) sym, context);
                        } else if (sym is ErrorDomain) {
-                               ns.add_error_domain ((ErrorDomain) sym);
+                               ns.add_error_domain ((ErrorDomain) sym, context);
                        } else if (sym is Field) {
                                unowned Field field = (Field) sym;
                                if (field.binding == MemberBinding.INSTANCE) {


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