[Issue 620] Can't use property syntax with a template function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 29 06:29:18 PDT 2011


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


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |k.hara.pg at gmail.com


--- Comment #5 from Kenji Hara <k.hara.pg at gmail.com> 2011-07-29 06:29:13 PDT ---
I think this is not enhancement at least D2.
opDispatch for property syntax needs fixing this issue.

struct S
{
    template opDispatch(string name)
    {
        @property int opDispatch(A...)(A args)
        {
          static if (args.length)
            return args[0];
          else
            return 0;
        }
    }
}
void main()
{
    S s;
    s.prop == 0;  // Error: s.opDispatch(A...) has no value
}

I have posted D2 patch.
https://github.com/D-Programming-Language/dmd/pull/280

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