# Does Vector{Int64} not inherit from Vector{Number}?

**URL:** <https://discourse.julialang.org/t/does-vector-int64-not-inherit-from-vector-number/103080>\
**Category:** New to Julia\
**Created:** [August 22, 2023, 4:21pm UTC](https://discourse.julialang.org/t/does-vector-int64-not-inherit-from-vector-number/103080 "2023-08-22T16:21:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leibniz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leibniz/32/217959_2.png) [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Post date:** [August 22, 2023, 4:21pm UTC](https://discourse.julialang.org/t/does-vector-int64-not-inherit-from-vector-number/103080/1 "2023-08-22T16:21:59Z")

</div>

Greetings,

I am just coding up my first little numerical simulation in Julia.

long story short:  
Why does this not work?

```julia
function func( x:: Vector{Number} )
    print(x)
end

func([1])

```

It gives ` MethodError: no method matching func(::Vector{Int64})`

How can I write this method with type annotation saying that the input vector can contain integers, floats or other numbers?

Regards!

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [August 22, 2023, 4:23pm UTC](https://discourse.julialang.org/t/does-vector-int64-not-inherit-from-vector-number/103080/2 "2023-08-22T16:23:03Z")

</div>

```julia
Vector{<:Number}

```

(see, for example, [Vector{Int} \<: Vector{Real} is false??? · JuliaNotes.jl](https://m3g.github.io/JuliaNotes.jl/stable/typevariance/) or this [Why [(a = 1, b = 3), (a = 3, b = 4)] isa Vector{NamedTuple} -\> false?](https://discourse.julialang.org/t/why-a-1-b-3-a-3-b-4-isa-vector-namedtuple-false/102981)).

---

<div class="post-metadata">

**Author:** ![Leibniz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leibniz/32/217959_2.png) [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Post date:** [August 22, 2023, 4:41pm UTC](https://discourse.julialang.org/t/does-vector-int64-not-inherit-from-vector-number/103080/3 "2023-08-22T16:41:53Z")

</div>

Thanks Imiq,  
the first link explained it well.
