digitalmars.D.bugs - [Issue 15352] New: template arguments matching error with delegates
- via Digitalmars-d-bugs (37/37) Nov 17 2015 https://issues.dlang.org/show_bug.cgi?id=15352
https://issues.dlang.org/show_bug.cgi?id=15352 Issue ID: 15352 Summary: template arguments matching error with delegates Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: incsall gmail.com struct S(T, T delegate(uint idx) supplier) { } auto make1(T, T delegate(uint idx) supplier)() { enum local = supplier; // allows to avoid an error S!(T, local) ret; return ret; } auto make2(T, T delegate(uint idx) supplier)() { S!(T, supplier) ret; // Error: template instance S!(uint, __dgliteral1) does not match template declaration S(T, uint delegate(uint idx) supplier) return ret; } unittest { enum dg = delegate(uint idx) => idx; S!(uint, dg) s; auto v = make1!(uint, dg)(); v = make2!(uint, dg)(); // throws compilation error } DMD32 D Compiler v2.069.0 --
Nov 17 2015