www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13062] New: "member x is not accessible" when passing field


          Issue ID: 13062
           Summary: "member x is not accessible" when passing field to
                    template parameter
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: doob me.com

The following code worked fine in DMD 2.064.2:

module foo;

static int f(A...)() { pragma(msg, typeof(A)); return 0; }

module bar;

import foo;

struct S { private int x; enum y = f!x(); }

With DMD 2.065.0 I get this error: "Error: struct bar.S member x is not
accessible". To me this looks very similar to issue 11946 [1], but Walter wants
me to create a new issue [2].

[1] https://issues.dlang.org/show_bug.cgi?id=11946#c42
[2] https://issues.dlang.org/show_bug.cgi?id=11946#c40

Jul 06 2014