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



--- Comment #10 from Stewart Gordon <s...@iname.com> 2012-02-01 05:27:34 PST ---
(In reply to comment #9)
> For (T : int) to be preferred over (T), it must return a worse 
> match level for the unspecialized parameter.  Currently it will 
> return MATCHconvert for these parameters, and return MATCHexact 
> only when there is a (matching) spec type.

So MATCHexact means "the pattern can be matched only by this exact set of
arguments", and MATCHconvert means "this is one of various sets of arguments
that can match this pattern".

But then, surely, it would be rejecting the instantiation as ambiguous, not
picking the (A...) overload.

Really, it's a fundamental flaw in the compiler logic whereby it conflates two
essentially orthogonal concepts: exactness and specialisation.

A correct template instantiation algorithm would:
- see which template patterns match the instantiation exactly
- if none, see which template patterns match with implicit conversions
- of all the matches, determine which is most specialised

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

Reply via email to