Overriding `var` members

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Summary

doubly_linked_node_base :=class:
    var Previous: doubly_linked_node_base

doubly_linked_node_child :=class(doubly_linked_node_base):
    var Previous<override>: doubly_linked_node_child    # Error

Error:

This overriding data definition must be a subtype of the definition it tried to override: localhost......doubly_linked_node_base.Previous(3602)

As you can see, the overriding data definition is definitely a subtype of the definition it tried to override, so the error should not appear.

The only thing that works is to change the default value of var members, but we can not make the type more specific.

Steps to Reproduce

Copy this into a device:

doubly_linked_node_base :=class:
    var Previous: doubly_linked_node_base

doubly_linked_node_child :=class(doubly_linked_node_base):
    var Previous<override>: doubly_linked_node_child    # Error

See the error

Expected Result

It should not show an error

Observed Result

It shows an error

Platform(s)

All

The status of UCB-1237 incident has been moved from ‘Needs Triage’ to ‘Closed’. Resolution Reason: ‘By Design’

What does “by Design” mean in this context?
The API documentation says, that we are supposed to be able to override fields in subclasses.

The error message itself is also wrong.

This overriding data definition must be a subtype of the definition it tried to override:

… It is a subtype of the definition it tried to override, isn’t it?