[Issue 19618] New: Incorrect conversion of function returning `typeof(null)` to function returning an associative array
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sat Jan 26 11:19:19 UTC 2019
    
    
  
https://issues.dlang.org/show_bug.cgi?id=19618
          Issue ID: 19618
           Summary: Incorrect conversion of function returning
                    `typeof(null)` to function returning an associative
                    array
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org
Fix for issue 8589 was incomplete.
---
void f(int[int] function() del)
{
    assert(!del());
}
typeof(null) g() { return null; }
void main()
{
    f(&g);
    f(() => null);
}
---
As typeof(null) is a pointer type, whilst associative arrays are value types. 
So can't possibly be covariant.
--
    
    
More information about the Digitalmars-d-bugs
mailing list