[Gambas-user] Overriding Color class
adamnt42 at gmail.com
Sun Oct 18 01:21:22 CEST 2020
On 18/10/20 9:37 am, Benoît Minisini wrote:
> Le 18/10/2020 à 01:02, Bruce a écrit :
>> So, this is no longer true:
>> 4.4. Project symbol table
>> Your project has its own private symbol, like any component, and can
>> export any of its classes to the global symbol table by using the
>> EXPORT keyword.
>> The project classes are loaded after all components. So your exported
>> class can override any exported classes declared in any component.
> You must take chapter 3.5 into account too.
A read/write property must be overridden by a read/write property.
A read-only property must be overridden by a read-only property.
Why? That's the whole point of what I am trying to do, override the
readonly properties of your Color class with configurable colors that
require the properties to be read/write.
I make no explicit references to your Color class, each color property
has its' own local state variable that is set when the class is loaded.
If I was excplicitly inheriting your Color class then I'd see why the
properties accessors must match, but I'm not.
Are you saying that if I accidentally create a class with the same name
as a class in some component then it implicitly inherits from that
class? I thought the namespacing was supposed to prevent that?
More information about the User