www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2472] New: Delegates are not lvalue.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2472

           Summary: Delegates are not lvalue.
           Product: D
           Version: 1.036
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: e.insafutdinov gmail.com


class A
{
        void foo()
        {
        }
}

int main()
{
        auto a = new A;
        auto x = (&a.foo).funcptr;
}

dmd output:
Error: &a.foo is not an lvalue


-- 
Nov 25 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2472





------- Comment #1 from e.insafutdinov gmail.com  2008-11-25 16:15 -------
while this works well:
auto dlg = &a.foo;
auto f_ptr = dlg.funcptr;


-- 
Nov 25 2008
prev sibling parent Brad Roberts <braddr bellevue.puremagic.com> writes:
 dmd output:
 Error: &a.foo is not an lvalue

Second bug on the same snippit of code, this error message lacks source file and line number info. I didn't try the code to see if it's just missing from the report or if dmd fails to include it.
Nov 25 2008