Override of properties not working as expected

Writing and using Classes in Dyalog APL
Post Reply
zaibot.w
Posts: 6
Joined: Mon Jun 29, 2020 4:09 pm

Override of properties not working as expected

Post by zaibot.w »

Hi there!

I've encountered a bug, which prohibits to access base properties, which have been overridden in subclasses.

Example:

Code: Select all

:Class Base

    :field private m_test←2
    :property test
    :access public overridable
        ∇ r←get
          r←m_test
        ∇
        ∇ set args
          m_test←args.NewValue
        ∇
    :endproperty

:EndClass

:Class Sub : Base

    :property test
    :access public override
        ∇ r←get
          r←⎕BASE.test
        ∇
        ∇ set args
          ⎕BASE.test←args.NewValue
        ∇
    :endproperty

:EndClass


Calling the getter results in a VALUE ERROR:

Code: Select all

      s←⎕new Sub
      s.test
VALUE ERROR
get_test[1] r←⎕BASE.test


Calling the setter results in an infinite loop.

I think that both calls should just delegate to the base functions.

Kind regards,
Tobias
Vince|Dyalog
Posts: 439
Joined: Wed Oct 01, 2008 9:39 am

Re: Override of properties not working as expected

Post by Vince|Dyalog »

Hi Tobias,

Thanks for reporting this! We have logged it as 19265 and have been investigating.

Regards,

Vince
Post Reply