digitalmars.D.bugs - [Issue 19035] New: Escape in scope inference, improve scope inference
- d-bugmail puremagic.com (57/57) Jun 27 2018 https://issues.dlang.org/show_bug.cgi?id=19035
https://issues.dlang.org/show_bug.cgi?id=19035 Issue ID: 19035 Summary: Escape in scope inference, improve scope inference Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: bugzilla digitalmars.com Consider: ---------- safe: void escape(int*); /**********************/ void frank()(ref scope int* p, int* s) { p = s; // should error here, does not } void testfrankly() { int* p; int i; frank(p, &i); // note that p now has a reference to i, and can outlast i } /**********************/ void betty()(int* p, int* q) { p = q; escape(p); } void testbetty() { int i; int j; betty(&i, &j); // should error on i and j, and it does } /**********************/ void archie()(int* p, int* q, int* r) { p = q; r = p; escape(q); } safe void testarchie() { int i; int j; int k; archie(&i, &j, &k); // should error only on j, not i and j } ------- --
Jun 27 2018