Override of properties not working as expected

Writing and using Classes in Dyalog APL

Override of properties not working as expected

Postby zaibot.w on Tue Aug 10, 2021 1:01 pm

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
zaibot.w
 
Posts: 5
Joined: Mon Jun 29, 2020 4:09 pm

Re: Override of properties not working as expected

Postby Vince|Dyalog on Thu Aug 19, 2021 12:04 pm

Hi Tobias,

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

Regards,

Vince
Vince|Dyalog
 
Posts: 357
Joined: Wed Oct 01, 2008 9:39 am


Return to Object Oriented Programming

Who is online

Users browsing this forum: No registered users and 1 guest