[Issue 21518] delegates not checked for attribute match in const arrays
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jan 1 20:39:36 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21518
moonlightsentinel at disroot.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |moonlightsentinel at disroot.o
| |rg
Summary|delegates not checked for |delegates not checked for
|attribute match in const |attribute match in const
|array parameters |arrays
--- Comment #1 from moonlightsentinel at disroot.org ---
This issue is not restricted to function parameters:
void delegates()
{
const dg = delegate() @system { int* p; int x; p = &x; };
// pragma(msg, typeof(dg)); // const(void delegate() pure nothrow @nogc
@system)
// No error
const(void delegate() @safe)[] arg = [ dg ];
// pragma(msg, typeof(arg)); // const(void delegate() @safe)[]
// Correctly fails
// void delegate() @safe[] arg = [ dg ];
}
--
More information about the Digitalmars-d-bugs
mailing list