# What's the difference between these two types with implicit and explicit parameters?

**URL:** https://discourse.julialang.org/t/whats-the-difference-between-these-two-types-with-implicit-and-explicit-parameters/62849
**Category:** General Usage
**Tags:** question, type, parametric-types
**Created:** [June 13, 2021, 6:08pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-these-two-types-with-implicit-and-explicit-parameters/62849 "2021-06-13T18:08:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)
#### Post date: [June 13, 2021, 6:08pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-these-two-types-with-implicit-and-explicit-parameters/62849/1 "2021-06-13T18:08:42Z")

</div>

```julia
julia> T1 = Vector{S} where {T<:Integer, S<:AbstractUnitRange{T}}
Vector{S} where {T<:Integer, S<:AbstractUnitRange{T}} (alias for Array{S, 1} where {T<:Integer, S<:AbstractUnitRange{T}})

julia> T2 = Vector{S} where {S<:AbstractUnitRange{<:Integer}}
Vector{S} where S<:(AbstractUnitRange{var"#s34"} where var"#s34"<:Integer) (alias for Array{S, 1} where S<:(AbstractUnitRange{var"#s34"} where var"#s34"<:Integer))

julia> T1 == T2
false

```

Could someone give me an example to explain the difference between the two?

---

<div class="post-metadata">

### Author: ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)
#### Post date: [June 13, 2021, 6:15pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-these-two-types-with-implicit-and-explicit-parameters/62849/2 "2021-06-13T18:15:00Z")

</div>

Ah the difference appears to be

```julia
julia> Vector{AbstractUnitRange{<:Integer}} <: T2
true

julia> Vector{AbstractUnitRange{<:Integer}} <: T1
false

```

---

<div class="post-metadata">

### Author: ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)
#### Post date: [June 13, 2021, 9:02pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-these-two-types-with-implicit-and-explicit-parameters/62849/3 "2021-06-13T21:02:36Z")

</div>

Is that intended? Because, I would suppose `<:` is like `<=` and you could chain any number of `xn <= ... <= x2 <= x1` and all variables would share the same upper bound, here it seems like the upper bound is lost (more akin `<`).

---

<div class="post-metadata">

### Author: ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)
#### Post date: [June 13, 2021, 9:31pm UTC](https://discourse.julialang.org/t/whats-the-difference-between-these-two-types-with-implicit-and-explicit-parameters/62849/4 "2021-06-13T21:31:11Z")

</div>

The difference is that `T1` requires all `AbstractUnitRange` to have the same eltype `T`, while the second allows different eltypes. Therefore the following are the same:

```julia
julia> T2 = Vector{S} where {S<:AbstractUnitRange{<:Integer}}
Vector{S} where S<:(AbstractUnitRange{var"#s1"} where var"#s1"<:Integer) (alias for Array{S, 1} where S<:(AbstractUnitRange{var"#s1"} where var"#s1"<:Integer))

julia> T3 = Vector{S} where {T<:Integer, S<:AbstractUnitRange{<:T}}
Vector{S} where {T<:Integer, S<:(AbstractUnitRange{var"#s1"} where var"#s1"<:T)} (alias for Array{S, 1} where {T<:Integer, S<:(AbstractUnitRange{var"#s1"} where var"#s1"<:T)})

julia> T2 == T3
true

```

(note the difference - in `T3` and additional `<:` is used before `T`.
