[Issue 23519] New: Unnecessary and inconsistent restrictions on delegate subtyping
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 29 21:54:29 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23519
Issue ID: 23519
Summary: Unnecessary and inconsistent restrictions on delegate
subtyping
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: timon.gehr at gmx.ch
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.
--
More information about the Digitalmars-d-bugs
mailing list