www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10698] New: opDispatch called even when it requires runtime arguments

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

           Summary: opDispatch called even when it requires runtime
                    arguments
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: monkeyworks12 hotmail.com


--- Comment #0 from monkeyworks12 hotmail.com 2013-07-22 10:45:41 PDT ---
import std.stdio;

struct Test1
{
    int i;
}

struct Test2
{
    Test1 test1;
    alias test1 this;

    int opDispatch(string id)(string dummy)
    {
        return 42;
    }
}

void main()
{
    Test2 test2;
    writeln(test2.i);
}

/d663/f665.d(22): Error: function f665.Test2.opDispatch!("i").opDispatch
(string dummy) is not callable using argument types ()


Fails on DMD 2.063, GDC 2.060, LDC 2.060, and git HEAD.

http://dpaste.dzfl.pl/c3a50642

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 22 2013