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)