Bug 3895 – Appending a double[] to a float[] generates wrong code

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-03-08T06:22:00Z
Last change time
2012-04-26T11:43:08Z
Keywords
accepts-invalid, wrong-code
Assigned to
yebblies
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2010-03-08T06:22:04Z
import std.stdio; void main() { double[] stuff = [1.,2.,3.,4.,5.]; float[] otherStuff; otherStuff ~= stuff; writeln(otherStuff); } Output: 0 1.875 0 2 0 2.125 0 2.25 0 2.3125
Comment #1 by schveiguy — 2010-03-08T06:34:29Z
When did this work? I tested back to 2.036 and it still results in the same output (was testing in case it was something I did in my append patch).
Comment #2 by dsimcha — 2010-03-08T07:50:20Z
You're right. What I can't figure out is how code that depended on this working seemed to work until now. It might have something to do with changes to the Appender struct, since the code that I noticed this in actually used an Appender instead of appending using ~=. Changing status from regression to major.
Comment #3 by yebblies — 2012-02-20T19:47:14Z
Wow this is awful.
Comment #4 by github-bugzilla — 2012-02-20T21:32:37Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/5aa1b47aedf85f9e67132e5fc7a1586d5f1b293a Merge pull request #446 from yebblies/issue3895 This only works because of a bug in dmd, and it was probably supposed to...
Comment #5 by github-bugzilla — 2012-02-20T21:36:19Z
Commit pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/4610715c33531a9d11613ab78eec6af70f0f4851 Merge pull request #156 from yebblies/issue3895 This only works because of a bug in dmd, and it was probably supposed to...
Comment #6 by github-bugzilla — 2012-04-26T11:42:31Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f20d0845f24361463acab77d314170b25b2825c4 fix Issue 3895 - Appending a double[] to a float[] generates wrong code