www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11772] New: Can't call function with `inout` `delegate` as argument


           Summary: Can't call function with `inout` `delegate` as
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com

--- Comment #0 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2013-12-19
18:38:31 MSK ---
This code should compile:
alias T = inout(int*) delegate(inout int*);

void f(T) { }

void main()
    T del;
    f(del); // line 8
main.d(8): Error: cannot implicitly convert expression (del) of type
inout(int*) delegate(inout(int*)) to const(int*) delegate(const(int*))

In spite of the error `const(int*) delegate(const int*)` doesn't work either.

Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 19 2013