www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19618] New: Incorrect conversion of function returning


          Issue ID: 19618
           Summary: Incorrect conversion of function returning
                    `typeof(null)` to function returning an associative
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

Fix for issue 8589 was incomplete.

void f(int[int] function() del)

typeof(null) g() { return null; }

void main()
    f(() => null);

As typeof(null) is a pointer type, whilst associative arrays are value types. 
So can't possibly be covariant.

Jan 26 2019