Thread overview
[Issue 7418] New: Overloading doesn't work with aliases declared inside templates
Apr 17, 2012
Kenji Hara
Apr 18, 2012
Walter Bright
February 01, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7418

           Summary: Overloading doesn't work with aliases declared inside
                    templates
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: siegelords_abode@yahoo.com


--- Comment #0 from siegelords_abode@yahoo.com 2012-02-01 11:34:05 PST ---
void test(uint a)
{

}

void test(char[] a)
{

}

template _test1(T = void)
{
    alias test _test1;
}

alias test _test2;

void main()
{
    _test2("a".dup);
    _test2(1U);

    _test1!()("a".dup); // Error: cannot implicitly convert expression
(_adDupT(&_D12TypeInfo_Aya6__initZ,cast(string)"a")) of type char[] to uint
    _test1!()(1U);
}

Note how the alias outside the template works fine, but the one inside the alias only picks up the lexically first match. Note that this works fine in D1.

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-04-17 01:27:45 PDT ---
https://github.com/D-Programming-Language/dmd/pull/886

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



--- Comment #2 from github-bugzilla@puremagic.com 2012-04-18 15:46:09 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/85d53d2ae46190f3fe5a1788594b15ee4cb7f0f4
fix Issue 7418 - Overloading doesn't work with aliases declared inside
templates

https://github.com/D-Programming-Language/dmd/commit/83acb3b4e58c1abe4e74f30819fb60490b547ff9 Merge pull request #886 from 9rnsr/fix7418

Issue 7418 - Overloading doesn't work with aliases declared inside templates

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


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: -------