D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15877 - [REG2.071beta] Some members are not visible by std.typecons.BlackHole
Summary: [REG2.071beta] Some members are not visible by std.typecons.BlackHole
Status: RESOLVED DUPLICATE of issue 15907
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: Martin Nowak
URL:
Keywords: rejects-valid
: 15826 (view as issue list)
Depends on:
Blocks:
 
Reported: 2016-04-05 02:49 UTC by jiki
Modified: 2016-08-24 17:42 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jiki 2016-04-05 02:49:17 UTC
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 Martin Nowak 2016-04-05 22:51:49 UTC
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 Martin Nowak 2016-08-08 10:20:39 UTC
Related to issue 15907.
Comment 3 Martin Nowak 2016-08-09 09:58:19 UTC
*** Issue 15826 has been marked as a duplicate of this issue. ***
Comment 4 Martin Nowak 2016-08-24 17:42:25 UTC

*** This issue has been marked as a duplicate of issue 15907 ***