www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22137] New: -preview=dip1000 enables visibility checks for


          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 puremagic.com
          Reporter: moonlightsentinel 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.

Jul 23 2021