Bug 10073 – Default opEquals depends on class declaration order with DMD HEAD

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-12T23:41:00Z
Last change time
2013-07-25T02:24:20Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
puneet

Comments

Comment #0 by puneet — 2013-05-12T23:41:51Z
Error shows up with: commit 4fbc77fa504c2d8ee4c7ef10edc70221a74742c3 Merge: 081c92a ce58435 Author: Hara Kenji <[email protected]> Date: Sun May 12 21:34:15 2013 -0700 Here is the reduced testcase. Error disappears if I move definition of Foo (line 16) anywhere before definition of Bar (line 13). struct Arr(T) { // 1 T[] dArr; // 2 alias dArr this; // 3 bool opEquals(Arr!T d) { // 4 foreach(idx, it; d) { // 5 if(this[idx] != it) { // 6 return false; // 7 } // 8 } // 9 return true; // 10 } // 11 } // 12 class Bar { // 13 Arr!Foo fooQ; // 14 } // 15 class Foo {} // 16 void main() {} // 17
Comment #1 by k.hara.pg — 2013-05-13T02:36:18Z
Comment #2 by github-bugzilla — 2013-05-14T12:06:53Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/7e2648c87821375a972e837c82d46fd0f64674ab fix Issue 10073 - Default opEquals depends on class declaration order with DMD HEAD
Comment #3 by github-bugzilla — 2013-07-25T02:24:20Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0675c0feabaa9af257c523a4738bcdb78df26dab fix Issue 10073 - Default opEquals depends on class declaration order with DMD HEAD Resolve forward reference correctly.