Bug 3268 – can't compare pointer to functions when one is const
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2009-08-27T14:10:00Z
Last change time
2015-06-09T01:20:08Z
Keywords
patch
Assigned to
nobody
Creator
andrei
Comments
Comment #0 by andrei — 2009-08-27T14:10:00Z
Comment #1 by andrei — 2009-08-27T14:11:13Z
void fun() {}
void main()
{
auto a = &fun;
const b = a;
assert(a == b);
}
This fails to compile. The error message is odd too:
Error: array equality comparison type mismatch, void function() vs const(void function())
The code should work.