www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7708] New: cannot implicitly assign delegate taking const to a delegate reference taking mutable

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

           Summary: cannot implicitly assign delegate taking const to a
                    delegate reference taking mutable
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: govellius gmail.com



main()
{
    alias int delegate( const int[] ) A;
    alias int delegate(       int[] ) B;

    A a;
    B b = cast(B) a; // OK

    B b2 = a; // Error: cannot implicitly convert expression (a) of type
              // int delegate(const(int[])) to int delegate(int[])
}

I think the cast is unnecessary, (b) should be allowed to point to a delegate
of type (A) as well.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 14 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7708


Manu <turkeyman gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |turkeyman gmail.com



I think you might have this around the wrong way...

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