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

           Summary: Problem with map() that yields Tuples
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-02-14 11:15:51 PST ---
import std.algorithm, std.typecons;
struct Foo1 { int x; }
alias Tuple!(int) Foo2;
void main() {
    auto m1 = map!((int x){ return Foo1(x); })([1, 2]); // OK
    auto m2 = map!((x){ return Foo2(x); })([1, 2]);     // OK
    auto m3 = map!((int x){ return Foo2(x); })([1, 2]); // Error
}


DMD 2.051 prints this error message that I don't understand:
test.d(7): Error: cannot implicitly convert expression (0) of type int to
Tuple!(int)

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

Reply via email to