www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16369] New: [REG 2.071] getSymbolsByUDA fails if type

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

          Issue ID: 16369
           Summary: [REG 2.071] getSymbolsByUDA fails if type inherits
                    private members
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: jbc.engelen gmail.com

File m.d:
```
class M
{
    private // comment out to "fix" the problem
    int mmm;
}
```


File a.d:
```
import m;

enum U;

class A : M
{
     U int aaa;
}

void main()
{
    import std.traits;
    alias E = getSymbolsByUDA!(A, U);
}
```

Command `dmd -c a.d` works with DMD 2.070.2, but fails with DMD 2.071.2-b2.

Error:
❯ dmd -c a.d
std/traits.d-mixin-6733(6733): Deprecation: m.M.mmm is not visible from class A
std/traits.d-mixin-6733(6733): Deprecation: m.M.mmm is not visible from module
traits
std/traits.d-mixin-6733(6733): Error: class a.A member mmm is not accessible
std/meta.d(770): Error: template instance std.traits.getSymbolsByUDA!(A,
U).pred!"mmm" error instantiating
std/meta.d(780):        instantiated from here: Filter!(hasSpecificUDA, "mmm")
std/meta.d(779):        instantiated from here: Filter!(hasSpecificUDA, "aaa",
"mmm")
std/meta.d(779):        instantiated from here: Filter!(hasSpecificUDA, "aaa",
"mmm", "toString", "toHash")
std/traits.d(6735):        instantiated from here: Filter!(hasSpecificUDA,
"aaa", "mmm", "toString", "toHash", "opCmp", "opEquals", "Monitor", "factory")
a.d(13):        instantiated from here: getSymbolsByUDA!(A, U)


Related bug (but not the same): https://issues.dlang.org/show_bug.cgi?id=15335
Related Phobos commit:
https://github.com/dlang/phobos/commit/79fd6aac7956179b300c43f3320347ce0c1fe46b
(no PR?)

--
Aug 10 2016