[Issue 12286] New: Can't use two alias parameters to class and subclass field

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 2 11:10:50 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12286

           Summary: Can't use two alias parameters to class and subclass
                    field
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: thecybershadow at gmail.com


--- Comment #0 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-03-02 21:10:49 EET ---
//////////// test.d ///////////
class A     { int i; }
class B : A { int j; }

template copy(alias a, alias b)
{
    void copy() { a = b; }
}

class C : B
{
    alias copyIJ = copy!(i, j);
}
///////////////////////////////

Error:
test.d(11): Error: template instance copy!(i, j) copy!(i, j) is nested in both
A and B

The template should be nested in the descendant type.

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


More information about the Digitalmars-d-bugs mailing list