Bug 16369 – [REG 2.071] getSymbolsByUDA fails if type inherits private members
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-08-10T13:04:42Z
Last change time
2018-03-23T09:42:52Z
Keywords
industry
Assigned to
No Owner
Creator
Johan Engelen
Comments
Comment #0 by jbc.engelen — 2016-08-10T13:04:42Z
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?)