Bug 8010 – Type deduction problem

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-05-01T04:15:35Z
Last change time
2024-12-13T17:59:42Z
Assigned to
No Owner
Creator
dlang+issues
Moved to GitHub: dmd#17547 →

Comments

Comment #0 by dlang+issues — 2012-05-01T04:15:35Z
private import std.range; void filter(R)(R, bool delegate(ElementType!R)) { } void main() { [1, 2, 3].filter(delegate bool(x) { return x < 3; }); } This tells me the type 'R' isn't defined, so it's a bug. More generally, getting delegates to work with templates is *too* painful. It may not look terribly 'severe' at first glance, but it makes lambdas pretty useless -- especially when /everything/ is inferred (e.g. if I had said x => x).
Comment #1 by robert.schadek — 2024-12-13T17:59:42Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17547 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB