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? ------------------------
Comment #1 by aliloko — 2012-03-07T17:19:49Z
Comment #2 by github-bugzilla — 2012-03-07T21:17:41Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e46bd9c44efe1697fdd81eb4915224733f371a9e fix Issue 6391 - Line-less error when passing the '.im' of floating pointer value by reference
Comment #3 by bugzilla — 2012-04-24T00:51:46Z
Works in 2.059.