[Issue 5878] New: Forward reference in returning superclass from template using is() expression (Breaks std.traits.BaseTypeTuple)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 24 00:50:54 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5878

           Summary: Forward reference in returning superclass from
                    template using is() expression (Breaks
                    std.traits.BaseTypeTuple)
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: kennytm at gmail.com
            Blocks: 340


--- Comment #0 from kennytm at gmail.com 2011-04-24 00:47:15 PDT ---
Test case:

------------------------
template J(A) {
    static if (is(A P == super))
        alias P J;
}

alias J!(A) Z;

class X {}
class A : X {}
------------------------
y.d(6): Error: forward reference to '(in X)'
------------------------

The template J is basically std.traits.BaseTypeTuple. Because of this bug, any
use of BaseTypeTuple!A before A is defined (not just X) will result in a
forward-reference bug.

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


More information about the Digitalmars-d-bugs mailing list