Bug 12203 – typeof(null) does not convert to "void delegate(float)"

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-19T12:02:00Z
Last change time
2014-02-20T17:31:23Z
Keywords
ice, pull
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2014-02-19T12:02:52Z
typeof(null) does not convert to "void delegate(float)". Both the implict as well as the explicit case do not work. Repro case: alias void delegate(float) func; func[] g_data; void set(U)(auto ref U v) { g_data[0] = v; // g_data[0] = null; // works } void main(string[] args) { set(null); }
Comment #1 by code — 2014-02-19T12:03:57Z
The error message is: Error: e2ir: cannot cast v of type typeof(null) to type void delegate(float)
Comment #2 by k.hara.pg — 2014-02-19T19:00:56Z
Comment #3 by github-bugzilla — 2014-02-20T15:53:35Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/1c50c4f268fa719434bb20ac885d7bfb12a019d3 fix Issue 12203 - typeof(null) does not convert to "void delegate(float)" https://github.com/D-Programming-Language/dmd/commit/d898c7f4604df448ac2a51f7352048468fb0d1d2 Merge pull request #3294 from 9rnsr/fix12203 Issue 12203 - typeof(null) does not convert to "void delegate(float)"