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



On Wed, 2008-07-23 at 06:19 -0700, Michael Lawrence wrote:


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?

That's not intentional, it shouldn't be possible for methods, either,
that's just a missing check.

However, I'm actually considering dropping this and only requiring the
developer to write `public` to export new symbols.

Any opinions on that?

Juerg




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