digitalmars.D.bugs - [Issue 24788] New: Template inferrence bug?
- d-bugmail puremagic.com (33/33) Oct 02 https://issues.dlang.org/show_bug.cgi?id=24788
https://issues.dlang.org/show_bug.cgi?id=24788 Issue ID: 24788 Summary: Template inferrence bug? Product: D Version: D2 Hardware: All URL: http://dlang.org/ OS: All Status: NEW Severity: normal Priority: P3 Component: dmd Assignee: nobody puremagic.com Reporter: turkeyman gmail.com void f(T)(const(T)[] x, const(T)* y) {} void test() { // this works; T is inferred as int int[] x; const int y; f(x, &y); // fails: expected that T is inferred as int* int*[] a; const int* b; f(a, &b); } Something about a/b being an arrangement of int* compared to x/y with int causes this to fail. I reckon the non-uniformity of this type deduction logic is a bug. This non-uniformity has caused me several problems with meta code. I think it's banging into an issue with const promotion; if you remove const from y and b, both cases work properly. --
Oct 02