summaryrefslogtreecommitdiff
path: root/vapigen
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-11-24 22:42:18 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2019-11-24 22:42:18 +0100
commite722f7640e01b405cc600f8a3b164dce3407d321 (patch)
tree14422087a2d13ff3ad6fa31547fb39bd2e704d2e /vapigen
parent6962b8d5440c9a0359d6a7860d386c0928170066 (diff)
downloadvala-e722f7640e01b405cc600f8a3b164dce3407d321.tar.gz
vala: Let the parser have set namespace members as static
... and move error reporting for invalid members into check()
Diffstat (limited to 'vapigen')
-rw-r--r--vapigen/valagidlparser.vala12
1 files changed, 10 insertions, 2 deletions
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 82f4b12cc..d4c70d8a2 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -384,11 +384,19 @@ public class Vala.GIdlParser : CodeVisitor {
} else if (sym is ErrorDomain) {
ns.add_error_domain ((ErrorDomain) sym);
} else if (sym is Field) {
- ns.add_field ((Field) sym);
+ unowned Field field = (Field) sym;
+ if (field.binding == MemberBinding.INSTANCE) {
+ field.binding = MemberBinding.STATIC;
+ }
+ ns.add_field (field);
} else if (sym is Interface) {
ns.add_interface ((Interface) sym);
} else if (sym is Method) {
- ns.add_method ((Method) sym);
+ unowned Method method = (Method) sym;
+ if (method.binding == MemberBinding.INSTANCE) {
+ method.binding = MemberBinding.STATIC;
+ }
+ ns.add_method (method);
} else if (sym is Namespace) {
ns.add_namespace ((Namespace) sym);
} else if (sym is Struct) {