https://issues.dlang.org/show_bug.cgi?id=18268

Jonathan M Davis <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
                   |                            |m

--- Comment #1 from Jonathan M Davis <[email protected]> ---
When a template is implicitly instantiated with a dynamic array, the type of
the slice of that dynamic array is used (which is tail-const if the dynamic
array is const or tail-immutable if it's immutable). It does that so that you
don't have to explicitly slice dynamic arrays all over the place when using
templated code (though unfortunately, it does mean that dynamic arrays are
treated a bit special, since nothing like this happens with other types).
Explicitly instantiating a template with a dynamic array uses the exact type,
because you're providing the exact type rather than using type inference.

What I don't know is why lambda stuff ends up inferring the exact type of the
dynamic array in some cases and the type you get when slicing it in others.

--

Reply via email to