[Issue 13103] New: struct initialization w/ null for Rebindable!(const Object) fails

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jul 11 19:30:33 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13103

          Issue ID: 13103
           Summary: struct initialization w/ null for Rebindable!(const
                    Object) fails
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: pro.mathias.lang at gmail.com

This code fails to compile under master
(2206d5075df746a7da28ad3697f6f6514e5217ca) and 2.065.0:

import std.typecons : Rebindable, rebindable;

struct Test {
    Rebindable!(Object) obj;
    Rebindable!(const Object) cobj;
}

void main()
{
    Test t1; // Okay                                                            
    Test t2 = Test(null); // Okay                                               
    t2.cobj = null; // Still okay                                               
    Test t3 = Test(null, null); // Error: cannot implicitly convert expression
(null) of type typeof(null) to Rebindable!(const(Object))                       
}

--


More information about the Digitalmars-d-bugs mailing list