[Issue 6776] New: attributes injected via pure template mixin but not class mixin

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 6 04:02:30 PDT 2011


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

           Summary: attributes injected via pure template mixin but not
                    class mixin
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dlang at chilon.net


--- Comment #0 from pelo <dlang at chilon.net> 2011-10-06 04:01:43 PDT ---
import std.stdio;

    class C(T) {
        T val;
    }

    class D {
        mixin C!bool;
    }

    int main() {
        auto d = new D;
        writeln(d.val);
        return 0;
    }

This fails to compile (no val in D), yet if defining C as:

    template C(T) {
        T val;
    }

It works.

This is rather silly as it forces me to write wrapper classes that forward to a
template.

-- 
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