[Issue 8010] New: Type deduction problem

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 1 04:14:24 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8010

           Summary: Type deduction problem
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: wfunction at hotmail.com


--- Comment #0 from wfunction at hotmail.com 2012-05-01 04:15:35 PDT ---
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).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list