Bug 6391 – Line-less error when passing the '.im' of floating pointer value by reference
Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-07-27T12:23:00Z
Last change time
2012-04-24T00:51:46Z
Keywords
diagnostic
Assigned to
nobody
Creator
kennytm
Comments
Comment #0 by kennytm — 2011-07-27T12:23:36Z
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?
------------------------