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



--- Comment #3 from Kenji Hara <k.hara...@gmail.com> 2013-10-14 20:44:15 PDT ---
(In reply to comment #1)
> While the version with an explicit slice does infer types, it is inferring the
> wrong ones.
> 
> k = uint
> v = Tuple!(string, "key", string, "value")
> 
> This is consistent with 2.63, without the explicit slice the types are
> 
> k = string
> v = string

In the first case (foreach (k, v; container)), both k and v should be inferred
to string.

However in the second case (foreach (k, v; container[])) you _cannot_ get same
inference result. Because std.range.InputRange interface defines an opApply
with indexing (size_t + KeyType), and it is preferentially used for foreach
argument type deduction.

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

Reply via email to