[Issue 13890] New: Comparing arrays within structs results in an assignment.
https://issues.dlang.org/show_bug.cgi?id=13890 Issue ID: 13890 Summary: Comparing arrays within structs results in an assignment. Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: normal Priority: P1 Component: druntime Assignee: nob...@puremagic.com Reporter: b.j.dej...@hotmail.com There seems to a bug when comparing two dynamic arrays contained within structs. The resulting operation is a comparison but also an assignment so the right answer is returned but the left hand side of the comparison now contains the elements of the right hand side of the comparison. The problem does not occur when comparing static arrays nor when comparing arrays normally or arrays contained within classes. The following code is the smallest version that always reproduces the bug on my system: struct Bug { float[] elements = new float[4]; public this(float[] elements...) { this.elements[] = elements[]; } public bool opEquals(const Bug other) { return other.elements[] == this.elements[]; } } unittest { import std.stdio; auto a = Bug(1,2,3,4); writeln(a.elements); // Bug([1, 2, 3, 4]) writeln(a == Bug(0,0,0,0)); // true?? -- This is where the bug happens. writeln(a.elements); // Bug([0, 0, 0, 0]) } When looking at it through the debugger it seems the array in a had all if it's elements reassigned to those in the temporary. --
[Issue 13890] Comparing arrays within structs results in an assignment.
https://issues.dlang.org/show_bug.cgi?id=13890 Ketmar Dark ket...@ketmar.no-ip.org changed: What|Removed |Added CC||ket...@ketmar.no-ip.org --- Comment #1 from Ketmar Dark ket...@ketmar.no-ip.org --- can't reproduce on DMD git head, x86. so the bug may be x86_64 specific. --
[Issue 13890] Comparing arrays within structs results in an assignment.
https://issues.dlang.org/show_bug.cgi?id=13890 --- Comment #2 from Kenji Hara k.hara...@gmail.com --- The issue status is unintentionally changed by merging the PR: https://github.com/D-Programming-Language/dmd/pull/3885 --
[Issue 5136] DDoc: listing methods in the 'Jump to' links may be undesirable
https://issues.dlang.org/show_bug.cgi?id=5136 --- Comment #11 from Nick Treleaven ntrel-...@mybtinternet.com --- Implemented hierarchically-grouped jump to links: https://github.com/D-Programming-Language/dlang.org/pull/726 As regards ddox, personally I'd rather browse module docs all in the same page, without having to keep waiting for pages to load each time I click a symbol. --
[Issue 5136] DDoc: listing methods in the 'Jump to' links may be undesirable
https://issues.dlang.org/show_bug.cgi?id=5136 Nick Treleaven ntrel-...@mybtinternet.com changed: What|Removed |Added Keywords||pull --
[Issue 7687] Ddoc should be able to generate Jump to links
https://issues.dlang.org/show_bug.cgi?id=7687 Nick Treleaven ntrel-...@mybtinternet.com changed: What|Removed |Added CC||ntrel-...@mybtinternet.com --- Comment #1 from Nick Treleaven ntrel-...@mybtinternet.com --- Stewart Gordon from comment #0) This is ridiculous. What was the point of writing this JS code to get around a limitation of Ddoc, rather than fixing the limitation? Using JS is much easier than extending dmd as long as dmd uses a subset of C++. Moreover, it would be good to give the user of Ddoc the choice of listing only module-level symbols or all documented symbols in the module. I've made a pull for Issue 5136 which (essentially) solves this. --