On Tue, May 5, 2015 at 2:18 PM, Zheng Wendell <[email protected]> wrote:
> So in the example above, the type parameter is redundant. However, in the
> following example, type parameter is not redundant, is it?
>
> ```
> f(x::AbstractArray{Real}) != f{T<:Real}(x::AbstractArray{T}) ?
> ```


Indeed, and neither is it for `f{T<:Any}(x::AbstractArray{T}, y::T)`.

—Pierre-Yves


> On Tue, May 5, 2015 at 10:35 AM, Alex <[email protected]> wrote:
>>>
>>> Is the type parameter redundant?
>>
>>
>> Yes, you always have `AbstractArray{T} <: AbstractArray == true`. See the
>> section on parametric abstract types in the manual. This also works for
>> (normal) composite types, e.g. `Rational{Int} <: Rational == true`.
>>
>> Best,
>>
>> Alex.
>
>

Reply via email to