Summary
A subtype which references a supertype datamember from a parametric interface reveals an “unknown identifier” LSP and build error.
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
Create a parametric interface with a datamember
my_interface(t:type) := interface:
Value:int = 3
Then, create a subtype (either interface or class) of my_interface(t:type)
.
To clarify, if the type of Value was t the issue would still prevail. I just chose not to use type t to make it clear its an overall issue and not so specific.
In the new subtypes, you can choose to make it parametric which than passes the type to the supertype interface, or you can simply define the type in the inheritance/implement argument position.
interface_example_one(t:type) := my_interface(t:type):
Value:t # This should get confused because `Value` is already a defined type in `my_interface(t:type)` but with a different type of `int`.
class_example_one := class(my_interface(float)):
Value:int # This should state "Value is already defined in 'my_interface', did you mean to add the <override> specifier?" but it doesn't.
class_example_two := class(my_interface(float)):
Value<override>:int = 4 # This gives an LSP warning: "'Value' is marked with the <override> specifier, but it doesn't override anything" even though it does.
Expected Result
Datamember should be recognized in subtypes. Should be overridable in classes (not available in interfaces).
Observed Result
Datamember is unrecognized. Has to be redefined.
Platform(s)
windows