[Issue 22137] New: -preview=dip1000 enables visibility checks for tupleof

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 23 20:59:56 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22137

          Issue ID: 22137
           Summary: -preview=dip1000 enables visibility checks for tupleof
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: moonlightsentinel at disroot.org

The following code is rejected only when compiling with -preview=dip1000:

=====================================
module a;

import b;

void main() @safe
{
    S s;
    s.tupleof[0] = 1;
}
=====================================
module b;

struct S
{
    private int i;
}
=====================================

a.d(8): Error: struct `b.S` member `i` is not accessible from `@safe` code

This error is completely unrelated to DIP1000 and should be removed or replaced
s.t. it triggers  without -preview=dip1000.

--


More information about the Digitalmars-d-bugs mailing list