GNOME Bugzilla – Bug 740068
access modifier don't work with namespace
Last modified: 2018-05-22 15:19:56 UTC
I can access to private member of namecpace. I can compile this code. namespace GUI { private int a; } void main() { GUI.a = 5; } I use vala 0.26 English isn't my native language. If I make a mistake, please correct me.
This is expected. Due to Vala->C semantics, namespaces are to be considered just... a namespace, and not an isolated module.
Excuse me. I do not understand. It is normal? I think, that members in namespaces should are encapsulated.
> It is normal? Is it normal?
No they are not. It's just a namespace, a space of names. NOT a module. Instead of writing Foo_bar, you can write Foo.bar.
According to the spec, this should not be possible. http://www.vala-project.org/doc/vala-draft/namespaces.html
Ben and the OP are correct. There is definitely a mismatch between the compiler and the documentation here. We should either fix the documentation or * implement access control on namespace level, * forbid using access modifiers for namespaces, * and/or warn that access modifiers are not (yet) honored.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/484.