www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7888] New: derivedMembers forward reference

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

           Summary: derivedMembers forward reference
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: code klickverbot.at



---
The different behavior of is() from bug 7868 depending on whether it was
invoked from a static if condition or not might be acceptable, but this example
is clearly a regression in my eyes:

---
module a;

struct A {
  import b : c;

  // Instantiate template which uses derivedMembers.
  alias D!A Test;

  // Unrelated template from other module - »not defined«.
  static if (c!()()) {}
}

// Just something using derivedMembers.
template D(T) {
  mixin({
    foreach (name; __traits(derivedMembers, T)) {}
    return "";
  }());
}
---
---
module b;
bool c()() { return true; }
---

It compiled fine in DMD 2.058, but fails with »template instance c!() template
'c' is not defined, did you mean a?« in latest Git master (7c22b8a), which is
absolutely not related to the cause of the error.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 10 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7888


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 10 2012