digitalmars.D.bugs - [Issue 20868] New: DIP1000: scope delegate is implicitly convertible
- d-bugmail puremagic.com (35/36) May 27 2020 https://issues.dlang.org/show_bug.cgi?id=20868
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: nobody puremagic.com Reporter: andrej.mitrovich gmail.com ----- 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.dThis should be a compile-time error. --
May 27 2020