digitalmars.D.bugs - [Issue 10592] New: Regression of overloaded template function
- d-bugmail puremagic.com (49/49) Jul 10 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10592
- d-bugmail puremagic.com (10/10) Jul 10 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10592
- d-bugmail puremagic.com (9/9) Jul 11 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10592
http://d.puremagic.com/issues/show_bug.cgi?id=10592
Summary: Regression of overloaded template function
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: regression
Priority: P2
Component: DMD
AssignedTo: nobody puremagic.com
ReportedBy: zan77137 nifty.com
This code doesn't work in dmd git head master:
--------------
struct A(E)
{
void put()(const(E)[] data)
{ pragma(msg, "hit 1"); }
void put()(const(dchar)[] data) if (!is(E == dchar))
{ pragma(msg, "hit 2"); }
void put(C)(const(C)[] data) if (!is(C == dchar) && !is(E == C))
{ pragma(msg, "hit 3"); }
}
void main()
{
A!char x;
x.put("abcde"c); // OK: hit 1
x.put("abcde"w); // NG: this should hit 3
x.put("abcde"d); // OK: hit 2
}
--------- RESULT -----------
$ dmd -run main
hit 1
hit 2
main.d(12): Error: template main.A!char.A.put does not match any function
templa
te declaration. Candidates are:
main.d(3): main.A!char.A.put()(const(E)[] data)
main.d(4): main.A!char.A.put()(const(dchar)[] data) if (!is(E == dchar))
main.d(5): main.A!char.A.put(C)(const(C)[] data) if (!is(C == dchar) &&
!
is(E == C))
main.d(12): Error: template main.A!char.A.put()(const(E)[] data) cannot deduce
t
emplate function from argument types !()(immutable(wchar)[])
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 10 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10592
Kenji Hara <k.hara.pg gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |pull, rejects-valid
https://github.com/D-Programming-Language/dmd/pull/2332
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 10 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10592
Kenji Hara <k.hara.pg gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 11 2013









d-bugmail puremagic.com 