January 26, 2019 [Issue 19618] New: Incorrect conversion of function returning `typeof(null)` to function returning an associative array | ||||
---|---|---|---|---|
| ||||
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@puremagic.com Reporter: ibuclaw@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. -- |
Copyright © 1999-2021 by the D Language Foundation