[Issue 1536] Literal '0' is improperly used to deduce an implicit template parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 28 11:25:43 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1536





------- Comment #2 from webmaster at villagersonline.com  2007-09-28 13:25 -------
Seems that I was wrong about what is written in the spec; I thought that the
type of literal was considered ambiguous until it was forced, by context, to be
something (such as assigning it to a variable, or passing it as a parameter).

So, let's make this bug more of a question about the language itself: Perhaps
we need to change integer literals to have their type inferred from context,
just like string literals.  IMHO, the code below looks pretty simple and seems
like it *ought* to work.  Is there a technical reason (other than just "it is
easier") why integer literals *shouldn't* be polysemous?


-- 



More information about the Digitalmars-d-bugs mailing list