Bug 23519 – Unnecessary and inconsistent restrictions on delegate subtyping

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-11-29T21:54:29Z
Last change time
2024-12-13T19:25:59Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
timon.gehr
Moved to GitHub: dmd#18138 →

Comments

Comment #0 by timon.gehr — 2022-11-29T21:54:29Z
DMD v2.101.0: class Super{} class Sub: Super{} void main(){ void delegate(Super) a0; void delegate(Sub) b0=a0; // error const(void delegate(Super))[] a1; const(void delegate(Sub))[] b1=a1; // ok Sub delegate() a2; Super delegate() b2=a2; // ok const(Sub delegate())[] a3; const(Super delegate())[] b3=a3; // error } All of those should work.
Comment #1 by robert.schadek — 2024-12-13T19:25:59Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18138 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB