Bug 15877 – [REG2.071beta] Some members are not visible by std.typecons.BlackHole
Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-04-05T02:49:00Z
Last change time
2016-08-24T17:42:25Z
Keywords
rejects-valid
Assigned to
code
Creator
jiki
Comments
Comment #0 by jiki — 2016-04-05T02:49:17Z
This came from the 2.071 change of the import rules.
I don't know whether a dmd or phobos issue.
And it is a deprecation massage, so we can suppress.
It also relates to Issue 15826.
CODE:
import std.typecons;
void main(string[] args)
{
auto a = new BlackHole!A;
a.method();
}
interface A {
abstract void method();
import std.stdio; // default is private
private alias a = int;
private void ft(R)(R range) { } // non-template is visible
}
OUTPUT:
phobos\std\traits.d(3677): Deprecation: test.A.std is not visible from module traits
phobos\std\traits.d(3677): Deprecation: test.A.a is not visible from module traits
phobos\std\traits.d(3677): Deprecation: test.A.ft(R)(R range) is not visible from module traits
Comment #1 by code — 2016-04-05T22:51:49Z
Both, the old and the new lookup don't really allow access to private members, even when using __traits. The new visibility rules will trigger earlier, that's why you see the warning.
We have to modify the lookup for traits so that it ignores symbol visibility.
Comment #2 by code — 2016-08-08T10:20:39Z
Related to issue 15907.
Comment #3 by code — 2016-08-09T09:58:19Z
*** Issue 15826 has been marked as a duplicate of this issue. ***
Comment #4 by code — 2016-08-24T17:42:25Z
*** This issue has been marked as a duplicate of issue 15907 ***