www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9405] New: __traits(parent) returns current module as imported package parent

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9405

           Summary: __traits(parent) returns current module as imported
                    package parent
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: m.strashun gmail.com


--- Comment #0 from Dicebot <m.strashun gmail.com> 2013-01-26 08:47:43 PST ---
version(1)
{
    import std.traits;
    import core.sync.barrier;
}

void main()
{
    version(2)
    {   
        import std.traits;
        import core.sync.barrier;
    }   
    pragma(msg, __traits(parent, std));
    pragma(msg, __traits(parent, core));
}
--------------------------------------
mist microfog:~/Documents/devel/playground$ dmd -o- -unittest -version=1 test.d 
module test
module test
mist microfog:~/Documents/devel/playground$ dmd -o- -unittest -version=2 test.d 
test.d(14): Error: argument std has no parent
false
test.d(15): Error: argument core has no parent
false
--------------------------------------

I am not 100% sure it is a bug, but difference in behavior between global and
scoped import + silence in docs on this matter makes me think so.

This is a reason std.traits unittest fail to me when I invoke them directly
via:
dmd -o- -unittest std/traits.d

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 26 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9405


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-01-26
10:02:19 PST ---
*** This issue has been marked as a duplicate of issue 8922 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 26 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9405



--- Comment #2 from Dicebot <m.strashun gmail.com> 2013-01-26 11:49:42 PST ---
Ah, so stupid from my side, checked for "parent"+"package" but only on open
ones.
I need to trust more in bug fixing speed :)
Thanks.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 26 2013