Jump to page: 1 2
Thread overview
[Issue 15907] Unjustified "is not visible from module" deprecation warning when using allMembers trait
[Issue 15907] Unjustified "is not visible from module" deprecation warning
[Issue 15907] Unjustified "is not visible from module" deprecation warning when using getMember trait
Apr 24, 2016
Philpax
May 24, 2016
Walter Bright
Jul 18, 2016
det
Jul 26, 2016
Ali Cehreli
Aug 15, 2016
Ali Cehreli
Aug 24, 2016
Martin Nowak
April 09, 2016
https://issues.dlang.org/show_bug.cgi?id=15907

m.bierlee@lostmoment.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |m.bierlee@lostmoment.com

--
April 09, 2016
https://issues.dlang.org/show_bug.cgi?id=15907

m.bierlee@lostmoment.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Unjustified "is not visible |Unjustified "is not visible
                   |from module" deprecation    |from module" deprecation
                   |warning                     |warning when using
                   |                            |allMembers trait

--
April 09, 2016
https://issues.dlang.org/show_bug.cgi?id=15907

m.bierlee@lostmoment.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Unjustified "is not visible |Unjustified "is not visible
                   |from module" deprecation    |from module" deprecation
                   |warning when using          |warning when using
                   |allMembers trait            |getMember trait

--
April 09, 2016
https://issues.dlang.org/show_bug.cgi?id=15907

--- Comment #1 from m.bierlee@lostmoment.com ---
I forgot to add that it's actually "getMember" which causes the deprecation warning and "allMembers" is not fully qualified.

--
April 24, 2016
https://issues.dlang.org/show_bug.cgi?id=15907

Philpax <me@philpax.me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |me@philpax.me

--- Comment #2 from Philpax <me@philpax.me> ---
Just ran into this issue as well - are there any "decent" workarounds? All I've found is manually excluding the problem objects before using getMember, but that's not really a scalable fix.

--
May 24, 2016
https://issues.dlang.org/show_bug.cgi?id=15907

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com
           Assignee|nobody@puremagic.com        |code@dawg.eu

--
July 18, 2016
https://issues.dlang.org/show_bug.cgi?id=15907

det <2krnk@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |2krnk@gmx.net

--
July 26, 2016
https://issues.dlang.org/show_bug.cgi?id=15907

Ali Cehreli <acehreli@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |acehreli@yahoo.com

--- Comment #3 from Ali Cehreli <acehreli@yahoo.com> ---
Here is another case with two modules (and with a WORKAROUND):

// ----- a.d:
mixin template MyMixin(alias MODULE) {
    shared static this() {
        initFunc!(mixin(MODULE))();
    }
}

void initFunc(alias MODULE)() {
    foreach (member; __traits(allMembers, MODULE)) {
        static if(__traits(hasMember, __traits(getMember, MODULE, member),
"someProperty")) {
        }
    }
}

// ----- b.d:
import a;

mixin MyMixin!__MODULE__;

void main() {
}

getMember inside a.d causes the following warnings:

a.d(9): Deprecation: b.object is not visible from module a
a.d(9): Deprecation: b.a is not visible from module a

Here is a WORKAROUND. Make the following changes in a.d:

1) Convert initFunc to a mixin template
2) Mix it in where it's called
3) Call it after it's mixed in

mixin template MyMixin(alias MODULE) {
    shared static this() {
        mixin initFunc!(mixin(MODULE));    // (2)
        initFunc();                        // (3)
    }
}

mixin template initFunc(alias MODULE) {    // (1)
    void initFunc() {
        foreach (member; __traits(allMembers, MODULE)) {
            static if(__traits(hasMember, __traits(getMember, MODULE, member),
"someProperty")) {
            }
        }
    }
}

Ali

--
August 15, 2016
https://issues.dlang.org/show_bug.cgi?id=15907

Ali Cehreli <acehreli@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |industry

--
August 24, 2016
https://issues.dlang.org/show_bug.cgi?id=15907

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jiki@red.email.ne.jp

--- Comment #4 from Martin Nowak <code@dawg.eu> ---
*** Issue 15877 has been marked as a duplicate of this issue. ***

--
« First   ‹ Prev
1 2