https://issues.dlang.org/show_bug.cgi?id=20868
Issue ID: 20868
Summary: DIP1000: scope delegate is implicitly convertible to
non-scope delegate
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: critical
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
-----
void scoped (scope void delegate() dg)
{
static void delegate()[] dgs;
// dgs ~= dg; // error
nonScoped(dg); // not an error???
}
void nonScoped (void delegate() dg)
{
static void delegate()[] dgs;
dgs ~= dg;
}
void main ()
{
int x;
scoped({x = 100;});
}
-----
$ dmd -dip1000 test.d
>
This should be a compile-time error.
--