[Issue 17764] [scope][DIP1000] Escape checker defeated by composition transformations
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Mar 11 21:51:51 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=17764
Walter Bright <bugzilla at digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #3 from Walter Bright <bugzilla at digitalmars.com> ---
The following remain:
---
@safe:
struct Context0x0 { char[] str; }
struct Parent0x1 { Context0x0 c; }
struct Parent0x2 { Context0x0[1] csa; }
struct Parent0x3 { Context0x0[] csl; }
struct Parent0x4 { Context0x0* cp; }
struct Parent0x5 { Parent0x1 p1; }
struct Parent0x6 { Parent0x5 p5; }
struct Parent0x7 { Parent0x6 p6; }
struct Parent0x8 { Parent0x2[1]* p2; }
struct Parent0x9 { Parent0x8[1] p8; }
struct Parent0xA { Parent0x9[1] p9; }
struct Parent0xB { Parent0x4* p4; }
struct Parent0xC { Parent0xB* pb; }
struct Parent0xD { Parent0xC* pc; }
char[] global;
void use0x2(scope char[]* arr)
{
global = *arr; // NG - accepts invalid
}
void use0x9(scope ref Parent0x4 p)
{
global = p.cp.str; // NG - accepts invalid
}
void use0xB(scope ref Parent0xA p)
{
global = (*p.p9[0].p8[0].p2)[0].csa[0].str; // NG - accepts invalid
}
void use0xC(scope ref Parent0xD p)
{
global = p.pc.pb.p4.cp.str; // NG - accepts invalid
}
---
All of them are instances of transitive scope, but scope is not transitive. Not
compiler bugs.
--
More information about the Digitalmars-d-bugs
mailing list