[Issue 10850] Inout substituted incorrectly for delegates/fptrs in inout function signature

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 19 02:57:40 PDT 2013


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


timon.gehr at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Inout substituted           |Inout substituted
                   |incorrectly for delegates   |incorrectly for
                   |in inout function signature |delegates/fptrs in inout
                   |                            |function signature


--- Comment #1 from timon.gehr at gmx.ch 2013-08-19 02:57:40 PDT ---
Other test case:

inout(int)* foo(inout(int)* a, inout(int)* delegate(inout(int)*) dg){
    return dg(a);
}
inout(int)* bar(inout(int)* a, inout(int)* delegate(inout(int)*) dg){
    auto x = dg(a);
    int* y;
    dg(y);
    return x;
}    
void main(){
    immutable int a;
    assert(foo(&a,x=>x) is &a); // error
    static assert(is(typeof(foo(&a,x=>x))==immutable(int)*)); // error
    assert(foo(&a,(immutable(int)* x)=>x) is &a); // error
}

This should compile.

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