# SubArray is not AbstractArray

**URL:** <https://discourse.julialang.org/t/subarray-is-not-abstractarray/9245>\
**Category:** General Usage\
**Created:** [February 22, 2018, 5:43am UTC](https://discourse.julialang.org/t/subarray-is-not-abstractarray/9245 "2018-02-22T05:43:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [February 22, 2018, 5:43am UTC](https://discourse.julialang.org/t/subarray-is-not-abstractarray/9245/1 "2018-02-22T05:43:05Z")

</div>

I was trying to fit a SubArray into a field of AbstractArray type and was surprised by this. I thought most, if not all, array types should be AbstractArray’s… Any reason why not?

```julia
julia> SubArray isa AbstractArray
false

```

---

<div class="post-metadata">

**Author:** ![jmert](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmert/32/3161_2.png) [@jmert](https://discourse.julialang.org/u/jmert)\
**Post date:** [February 22, 2018, 5:50am UTC](https://discourse.julialang.org/t/subarray-is-not-abstractarray/9245/2 "2018-02-22T05:50:40Z")

</div>

I think you want/need `SubArray <: AbstractArray` instead.

I think of `x isa T` as translating to `typeof(x) <: T`.
