[Issue 4998] make IFTI use the template constraint when determining the type of literals

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4998

Iain Buclaw  changed:

   What|Removed |Added

   Priority|P2  |P4

--


[Issue 4998] make IFTI use the template constraint when determining the type of literals

2011-11-17 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4998



--- Comment #1 from Steven Schveighoffer  2011-11-17 
06:35:08 PST ---
I will add that the simple example has a simpler solution, but the real problem
(of wrapping arbitrary overload sets) is not solved that way.

Reforming the example:

void foo(short s) {}
void foo(wstring s) {}

void foo2(T)(T t) {foo(t);}
void main()
{
   foo(1);
   foo("hello");
   foo2(1); // fails
   foo2("hello"); // fails
}

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