[Issue 21537] Function pointer* pointer' attributes not covariant when referencing (delegates' are)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 22 14:16:16 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21537

--- Comment #3 from Bolpat <qs.il.paperinik at gmail.com> ---
> The premise of this bug report is wrong, it passes a_pointer_ to a function pointer instead of the function pointer.

How is a pointer to a function pointer morally different from a pointer to a
delegate or a pointer to a class object reference?

If types T and S have a subtyping relationship like T ⊆ S, then const(T)* ⊆
const(S)*; at least, this is the case when T and S are class types or when T
and S are delegate types, but fails when T and S are function pointer types.

--


More information about the Digitalmars-d-bugs mailing list