[Issue 21537] Pointer to function pointer cannot be converted to pointer to const function pointer with lower attributes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 7 19:15:19 UTC 2021


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

Bolpat <qs.il.paperinik at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |regression

--- Comment #7 from Bolpat <qs.il.paperinik at gmail.com> ---
(In reply to moonlightsentinel from comment #6)
> For reference:
>
> // Error: cannot implicitly convert expression
> `safeDgPtr` of type `const(void delegate() @safe)*` to `const(void
> delegate())*`

Seems like it's become a regression, too. Compiling the code linked obove
(https://run.dlang.io/is/zSNArx) with all DMDs gives:

2.079.1 to 2.095.1: Failure with output:
-----
onlineapp.d(69): Error: function `onlineapp.FunctionPtrContext.g(const(void
function())* _param_0)` is not callable using argument types `(void function()
@safe*)`
onlineapp.d(69):        cannot pass argument `& safeFp` of type `void
function() @safe*` to parameter `const(void function())* _param_0`
-----

Since      2.096.1: Failure with output:
-----
onlineapp.d(45): Error: function `onlineapp.DelegateContext.g(const(void
delegate())* _param_0)` is not callable using argument types `(void delegate()
@safe*)`
onlineapp.d(45):        cannot pass argument `& safeDG` of type `void
delegate() @safe*` to parameter `const(void delegate())* _param_0`
onlineapp.d(69): Error: function `onlineapp.FunctionPtrContext.g(const(void
function())* _param_0)` is not callable using argument types `(void function()
@safe*)`
onlineapp.d(69):        cannot pass argument `& safeFp` of type `void
function() @safe*` to parameter `const(void function())* _param_0`
-----

2.079.1 to 2.095.1 has no problem with the delegates.

--


More information about the Digitalmars-d-bugs mailing list