[Issue 8441] New: function expected, not <my function>

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 25 14:06:25 PDT 2012


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

           Summary: function expected, not <my function>
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: ellery-newcomer at utulsa.edu


--- Comment #0 from Ellery Newcomer <ellery-newcomer at utulsa.edu> 2012-07-25 14:06:24 PDT ---
code:

mixin template T(string i) {
    auto j(string s="a", U)(U u1, U u2) {
        return 0;
    }
    auto j(int i,string s="a", W)(W u1, W u2) {
        return i;
    }

    mixin("
    class F" ~ i ~ " {
    auto j(string s=\"a\", U)(U u1, U u2) {
        return this.outer.t" ~ i ~ ".j!(s,U)(u1,u2);
    }
    auto j(int i,string s=\"a\", W)(W u1, W u2) {
        return this.outer.t" ~ i ~ ".j!(i,s,W)(u1,u2); <- dmd is giving error
for j!(...).j's type
    }
    }
    auto f"~i~"() {
        return new F"~i~"();
    }
    ");

}

class X {
    mixin T!("1") t0;
    alias t0 t1;
}
void main (){ 
    X x = new X();
    x.f1().j!(3,"a")(2.2, 3.3);
}


fireworks:

tok.d(15): Error: function expected before (), not 'this.this.j!(3,"a",double)'
tok.d(31): Error: template instance tok.X.T!("1").F1.j!(3,"a",double) error
instantiating

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