www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19710] New: [Home]

https://issues.dlang.org/show_bug.cgi?id=19710

          Issue ID: 19710
           Summary: [Home]
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: regression
          Priority: P3
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: alex sunopti.com

import std.stdio;

void attribute(string attributeName,T)(ref T x)
{
        mixin(
                "x." ~ attributeName ~ " = 10;"
        );
}

void main()
{
        class A
        {
                int b;
                void load()
                {
                        attribute!"b"(this);    //error: template
main.attribute cannot deduce function from argument types !("b")(A), candidates
are:    attribute!"b"(this);
                }
        }

        auto a = new A;
        attribute!"b"(a);       //OK.


}

This compiles in gdc 6, but fails in gdc8 and dlang.org web compiler.

--
Feb 28 2019