[Issue 4953] opBinary, opBinaryRight don't do implicit conversion properly
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Sep 30 09:47:52 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4953
--- Comment #3 from Don <clugdbug at yahoo.com.au> 2010-09-30 09:47:34 PDT ---
Wow. This is a lot more general than I thought. Consider this code:
void foo(T = void)(short x) {}
void main()
{
foo(5);
}
This compiled in 2.030, failed in 2.031 and later.
However, if you change 'short' to 'long', it works.
It's because of mtype.c, TypeBasic::implicitConvTo(), line 3010.
Implicit conversion to a smaller size is disallowed. That's fine in general,
but shouldn't be true of template deduction.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list