Attempting to override identifiers with `<protected>` access specifier fails Verse build in parametric classes

Summary

The Verse <protected> access specifier on identifiers should support the docs definition of restricting access to “the current class and any subtypes” when working with parametric classes (like it does for non-parametric classes). Instead, the LSP and build error message states: “cannot override an inaccessible parent definition”

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

Write a parametric class with a method that has a <protected> access specifier

my_class(t:type) := class:

    MyFunc<protected>():void =
        void

Inherit the class and write a subtype which overrides the <protected> function

my_child_class(t:type) := class(my_class(t)):
    MyFunc<override>():void =
        Print("Hello")

Expected Result

The LSP or Verse build toolchain should not give any issues with overriding the <protected> identifier.

Observed Result

The LSP and Verse build toolchain throw errors with overriding the <protected> identifier stating you “cannot override an inaccessible parent definition”

Platform(s)

windows

Additional Notes

Temporary fix: change the protected fields to public and manually avoid calling pseudo-protected functions (prone to programmer error).

FORT-933231 has been added to our ‘To Do’ list. Someone’s been assigned this task.