www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10073] New: Default opEquals depends on class declaration order with DMD HEAD

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10073

           Summary: Default opEquals depends on class declaration order
                    with DMD HEAD
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: puneet coverify.org


--- Comment #0 from Puneet Goel <puneet coverify.org> 2013-05-12 23:41:51 PDT
---
Error shows up with:
commit 4fbc77fa504c2d8ee4c7ef10edc70221a74742c3
Merge: 081c92a ce58435
Author: Hara Kenji <k.hara.pg+dev gmail.com>
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 12 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10073


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-05-13 02:36:18 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2025

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 13 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10073



--- Comment #2 from github-bugzilla puremagic.com 2013-05-14 12:06:53 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 14 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10073


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 14 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10073



--- Comment #3 from github-bugzilla puremagic.com 2013-07-25 02:24:20 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 25 2013