[Issue 7618] New: delegate/function pointer call bypass parameter storage class

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 1 03:51:07 PST 2012


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

           Summary: delegate/function pointer call bypass parameter
                    storage class
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2012-03-01 03:51:02 PST ---
Test case:
----
void foo(const int x)
{
    int func(ref int) { return 1; }
    func(x);
    // Error: function test.foo.func (ref int x) is not callable
    // using argument types (const(int))
    / --> OK

    int delegate(ref int) dg = (ref int x) => 1;
    dg(x);
    // --> compiles without error, bad!

    int function(ref int) fp = (ref int x) => 1;
    fp(x);
    // --> compiles without error, bad!
}

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