After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740068 - access modifier don't work with namespace
access modifier don't work with namespace
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Semantic Analyzer
unspecified
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-13 15:10 UTC by alsoijw
Modified: 2018-05-22 15:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description alsoijw 2014-11-13 15:10:51 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.
Comment 1 Luca Bruno 2014-11-13 21:13:32 UTC
This is expected. Due to Vala->C semantics, namespaces are to be considered just... a namespace, and not an isolated module.
Comment 2 alsoijw 2014-11-14 14:05:07 UTC
Excuse me. I do not understand. It is normal? I think, that members in namespaces should are encapsulated.
Comment 3 alsoijw 2014-11-14 14:06:44 UTC
> It is normal?

Is it normal?
Comment 4 Luca Bruno 2014-11-14 14:08:56 UTC
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.
Comment 5 Ben 2015-09-25 00:26:28 UTC
According to the spec, this should not be possible. 
http://www.vala-project.org/doc/vala-draft/namespaces.html
Comment 6 Michael 'Mickey' Lauer 2018-02-26 07:49:37 UTC
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.
Comment 7 GNOME Infrastructure Team 2018-05-22 15:19:56 UTC
-- 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.