Page 1 of 1

Override of properties not working as expected

Posted: Tue Aug 10, 2021 1:01 pm
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

Re: Override of properties not working as expected

Posted: Thu Aug 19, 2021 12:04 pm
by Vince|Dyalog
Hi Tobias,

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

Regards,

Vince