On Monday, 4 January 2021 at 14:44:00 UTC, Ola Fosheim Grøstad
wrote:
On Monday, 4 January 2021 at 14:40:31 UTC, ag0aep6g wrote:
You didn't replace "Bar!int" with "Foo!int". You replaced
"Bar!T" with "Foo!T". That's something else entirely.
No, it isn't. When it is instantiated you get "Bar!int" and
then the unification would substitute that with "Foo!int".
This is basic type system design. Nothing advanced. Just plain
regular unification.
This should even be worth discussing... the fact that it is
being debated isn't promising for D's future...
Also, keep in mind that the type isn't "Foo", that is also just a
name! The true type would be a nominal "struct _ {}". If you
through alias say that an object has two equivalent names, then
the type system better behave accordingly.