GNOME Bugzilla – Bug 592577
Vala does not enforce protected member access
Last modified: 2010-01-29 18:06:12 UTC
The Vala reference manual draft says "protected" asserts that the member will be visible to any code within this class, and also to any code that is in a subclass of this class. And yet the following program builds without an error: class Foo { protected void xyz() { } } void main() { Foo foo = new Foo(); foo.xyz(); } So either the compiler (I'm using Vala 0.7.5) is failing to enforce the protected access restriction, or the documentation is wrong. In either case this should be fixed.
Confirming. 'protected' is not yet enforced.
*** Bug 592826 has been marked as a duplicate of this bug. ***
Created attachment 152530 [details] [review] Enforce protected member restrictions for classes That seems to do the trick for me. Should address 592577, at least partially.
commit 9a06f450b9801c1f79e5819185e1af84e7dba3c5 Author: Marc-André Lureau <marcandre.lureau@gmail.com> Date: Fri Jan 29 00:56:46 2010 +0100 Enforce protected member restrictions Fixes bug 592577.