[Issue 6391] New: Line-less error when passing the '.im' of floating pointer value by reference

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 27 12:23:38 PDT 2011


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

           Summary: Line-less error when passing the '.im' of floating
                    pointer value by reference
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: kennytm at gmail.com


--- Comment #0 from kennytm at gmail.com 2011-07-27 12:23:36 PDT ---
Test case:

----------------
void s6391(ref double x){}
void bug6391() {
    double d = 1;
    s6391(d.im);
}
----------------
x.d(4): Error: function x.s6391 (ref double x) is not callable using argument
types (double)
Error: 0 is not an lvalue
----------------

With template methods, it becomes hard to trace back where is the cause of this
line-less error, e.g.

------------------------
void t6391(R)(ref R x){
    if (x.re > 0)
        t6391(x.im);
}
void bug6391b() {
    double d = 1;
    t6391(d);
}
------------------------
Error: 0 is not an lvalue                                              //
where?
x.d(7): Error: template instance x.t6391!(double) error instantiating  // why?
------------------------

-- 
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