Bugs as enhancements
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Sun Dec 27 13:36:44 UTC 2020
This fails to compile:
struct Foo(T) {}
alias Bar(T) = Foo!T;
void f(T)(Bar!T x) {}
void main() {
f(Bar!int());
}
as the type resolution fails to unify the alias Bar with the type
Foo. I think this is a basic type system failure, basic type
unification should easily resolve this:
https://www.google.com/search?q=implement+type+unification
https://en.wikipedia.org/wiki/Unification_(computer_science)
Bearophile reported it in 2013:
https://issues.dlang.org/show_bug.cgi?id=10884
And it has been classified as a duplicate of a 2008 issue:
https://issues.dlang.org/show_bug.cgi?id=1807
It has been misclassified as "enhancement", when it actually
should be classified as a "critical type system failure".
The problem (or related problems) has been discussed in a DIP and
in a pull request and DIP:
https://github.com/dlang/dmd/pull/9778
https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1023.md
When will this issue get the love it deserves? Fixing such
in-your-face type system failures ought to be much more important
than adding new features, surely?
7-12 years to fix such basic type system functionality is quite a
long time considering the many features that has been added in
that time period.
(Btw, this works perfectly fine in C++).
More information about the Digitalmars-d
mailing list