[Issue 9159] New: Variable and function name are the same in mixin template can't be compiled

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 15 02:38:35 PST 2012


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

           Summary: Variable and function name are the same in mixin
                    template can't be compiled
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: repeatedly at gmail.com


--- Comment #0 from Masahiro Nakagawa <repeatedly at gmail.com> 2012-12-15 02:38:11 PST ---
I and youkei hit this issue in msgpack-d.

I reproduced the bug as following.
dmd 2.060 works fine but a compilation error happened in git HEAD :

-----
struct P
{
    this(int i) { }
}

P p(int i)
{
    return typeof(return)(i);
}

mixin template DefineP()
{
    P p = p(10);  // Error: struct P does not overload ()
    P p = P(10);  // OK!
}

void main()
{
    mixin DefineP;
    //P p = p(10);  // OK!
}
-----

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