Re: [Vala] property overrides need to be declared public?





On Wed, Jul 23, 2008 at 2:43 AM, Jürg Billeter <j bitron ch> wrote:
On Fri, 2008-06-27 at 22:42 -0700, Michael Lawrence wrote:
> When overriding a property, I found that I needed to declare it
> 'public' before it was actually accessible (i.e. the internal getter
> function was defined but the override was not registered in
> class_init). Is this by design? It's certainly strange to privately
> override something.

The convention in Vala and C# are that the accessibility of the
overriding method must be the same as the accessibility of the
overridden method. We might want to consider to allow more flexibility
at some point, however, at the moment you should follow the convention.

This makes sense, but why is it possible to omit the "public" keyword when overriding a method, but not for a property?
 

Juerg




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