wybe icon indicating copy to clipboard operation
wybe copied to clipboard

Inside a submodule, there should be a nickname for ancestor types

Open pschachte opened this issue 2 months ago • 2 comments

In a type module, you can specify the current type as _, but in a submodule, you can't use that nickname, as _ specifies the submodule name. So if you want to use the parent type name inside a submodule, you have to spell it out.

pschachte avatar Nov 07 '25 12:11 pschachte

Something like _._ should refer to the parent. This generalised to grandparents _._._, etc.

It could also be used to refer to a sibling module, too, with _._.foo being the parent's foo module.

jimbxb avatar Nov 07 '25 13:11 jimbxb

Nice, that seems pretty intuitive. Let's go with that.

pschachte avatar Nov 10 '25 00:11 pschachte