Bug 5742 – Delegate Covariance

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-03-16T10:01:00Z
Last change time
2011-03-16T10:08:31Z
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2011-03-16T10:01:36Z
class A {} class B : A {} void main() { A delegate() foo; B delegate() bar; foo = bar; } Error: cannot implicitly convert expression (bar) of type B delegate() to A delegate() Is there any reason why this shouldn't work?
Comment #1 by schveiguy — 2011-03-16T10:08:31Z
*** This issue has been marked as a duplicate of issue 3180 ***