Thread overview
[Issue 8319] New: selective scoped import
Jun 29, 2012
Ellery Newcomer
Jun 30, 2012
Ellery Newcomer
Jun 30, 2012
Kenji Hara
June 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8319

           Summary: selective scoped import
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: ellery-newcomer@utulsa.edu


--- Comment #0 from Ellery Newcomer <ellery-newcomer@utulsa.edu> 2012-06-29 15:21:41 PDT ---
..doesn't work

for example:

auto z(T)(T x) {
    import std.traits: isPointer;
    static assert(isPointer!T);

    return 1;
}
void main() {
    z(1);
    z("a".ptr);
}


gives me:

test.d(3): Error: template instance isPointer!(int) template 'isPointer' is not
defined
test.d(8): Error: template instance test.z!(int) error instantiating
test.d(3): Error: template instance isPointer!(immutable(char)*) template
'isPointer' is not defined
test.d(9): Error: template instance test.z!(immutable(char)*) error
instantiating


whereas:

auto z(T)(T x) {
    import std.traits;
    static assert(isPointer!T);

    return 1;
}
void main() {
    z(1);
    z("a".ptr);
}

sees isPointer and asserts as expected.

dmd 2.059.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 29, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8319


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc


--- Comment #1 from bearophile_hugs@eml.cc 2012-06-29 16:30:27 PDT ---
This is a dupe, please search for it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 30, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8319



--- Comment #2 from Ellery Newcomer <ellery-newcomer@utulsa.edu> 2012-06-29 17:26:09 PDT ---
(In reply to comment #1)
> This is a dupe, please search for it.

before posting, I searched for scoped import and got nothing.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 30, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8319


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2012-06-29 21:48:47 PDT ---
This is a dup of issue 7494, and it's already fixed in 2.060head.

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

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