www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10375] New: private template from imported module hijacks a template type parameter(!)

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

           Summary: private template from imported module hijacks a
                    template type parameter(!)
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dmitry.olsh gmail.com


--- Comment #0 from Dmitry Olshansky <dmitry.olsh gmail.com> 2013-06-16
04:34:03 PDT ---
Example:

import std.typetuple;

void packIt(Pack)(Pack p){ }  //3

void main()
{
    packIt!(int)(2); //7
}

Produces:
bug_alias.d(3): Error: module bug_alias std.typetuple.Pack(T...) is private
bug_alias.d(7): Error: template instance bug_alias.packIt!(int) error
instantiating

Used a recent dmd from github master HEAD.

Related code from std.typetuple:

private template Pack(T...)
{
    alias T tuple;

    // For convenience
    template equals(U...)
    {
        static if (T.length == U.length)
        {
            static if (T.length == 0)
                enum equals = true;
            else
                enum equals = isSame!(T[0], U[0]) &&
                    Pack!(T[1 .. $]).equals!(U[1 .. $]);
        }
        else
        {
            enum equals = false;
        }
    }
}

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid
            Summary|private template from       |[REG2.061] private template
                   |imported module hijacks a   |from imported module
                   |template type parameter(!)  |hijacks a template type
                   |                            |parameter(!)
           Severity|normal                      |regression


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-06-16 20:33:59 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2191

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra gmail.com


--- Comment #2 from Kenji Hara <k.hara.pg gmail.com> 2013-06-16 20:56:41 PDT ---
*** Issue 10385 has been marked as a duplicate of this issue. ***

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



--- Comment #3 from github-bugzilla puremagic.com 2013-06-24 00:14:01 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c544a2c05dc5513d71d060b91a8f11d941ce8c2f
fix Issue 10375 - private template from imported module hijacks a template type
parameter(!)

https://github.com/D-Programming-Language/dmd/commit/791fa018008c811dd13aa5e45e6a4b201042af22
Merge pull request #2191 from 9rnsr/fix10375

[REG2.061] Issue 10375 - private template from imported module hijacks a
template type parameter(!)

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



--- Comment #4 from github-bugzilla puremagic.com 2013-06-24 00:18:56 PDT ---
Commit pushed to 2.063 at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/46186a4551e2ce98423139de228cdad86eaea634
Merge pull request #2191 from 9rnsr/fix10375

[REG2.061] Issue 10375 - private template from imported module hijacks a
template type parameter(!)

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


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


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