# Eltypes of \`view\`s

**URL:** https://discourse.julialang.org/t/eltypes-of-view-s/65606
**Category:** Performance
**Tags:** eltype
**Created:** [July 31, 2021, 3:52pm UTC](https://discourse.julialang.org/t/eltypes-of-view-s/65606 "2021-07-31T15:52:27Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [July 31, 2021, 4:04pm UTC](https://discourse.julialang.org/t/eltypes-of-view-s/65606/3 "2021-07-31T16:04:43Z")

</div>

Yeah. It’s definitely lying about the internal memory of the object, since the underlying vector still has room for the `Missing` mask.

I’m thinking of scenarios where functions have overly-restrictive type parameters

```julia
foo(x::AbstractVector{Int})
t = [1, 2, missing]
sub_t = view(t, 1:2)
foo(sub_t)

```

I’m not sure if just overloading the `eltype` is enough, right? It has to actually be in the type parameter.

---

_[View the full topic](https://discourse.julialang.org/t/eltypes-of-view-s/65606)._
