# Strange behavior in type system with Adjoint and DenseArray

**URL:** <https://discourse.julialang.org/t/strange-behavior-in-type-system-with-adjoint-and-densearray/22127>\
**Category:** Internals & Design\
**Created:** [March 20, 2019, 10:43pm UTC](https://discourse.julialang.org/t/strange-behavior-in-type-system-with-adjoint-and-densearray/22127 "2019-03-20T22:43:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![raphbacher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raphbacher/32/6019_2.png) [@raphbacher](https://discourse.julialang.org/u/raphbacher)\
**Post date:** [March 20, 2019, 10:43pm UTC](https://discourse.julialang.org/t/strange-behavior-in-type-system-with-adjoint-and-densearray/22127/1 "2019-03-20T22:43:56Z")

</div>

Hi,  
I’m trying to tackle issue #24590 ([https://github.com/JuliaLang/julia/issues/24590](https://github.com/JuliaLang/julia/issues/24590)).  
To do so I want to add a method to deal with transpose/adjoint of dense vectors (to call BLAS.dotc).  
I don’t understand why the third line below returns false

```julia
julia> a = rand(ComplexF64, 1000);

julia> isa(a',Adjoint{Complex{Float64},Array{Complex{Float64},1}})
true

julia> isa(a',Adjoint{Complex{Float64},DenseArray{Complex{Float64},1}})
false

julia> isa(a',Adjoint{Complex{Float64},<:DenseArray{Complex{Float64}}})
true

julia> typeof(a')
Adjoint{Complex{Float64},Array{Complex{Float64},1}}

```

Thanks for any insight 🙂

---

<div class="post-metadata">

**Author:** ![improbable22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/improbable22/32/5464_2.png) [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Post date:** [March 20, 2019, 11:59pm UTC](https://discourse.julialang.org/t/strange-behavior-in-type-system-with-adjoint-and-densearray/22127/2 "2019-03-20T23:59:46Z")

</div>

There are big words for this, but this is just how parametric types work in Julia. If you think of `isa` as being a `<:` relation, this only applies to the outermost type, the parameters must be `==` unless you say otherwise:

```julia
julia> Array{Float64,1} <: AbstractArray{Float64,1}
true

julia> Array{Float64,1} <: AbstractArray{AbstractFloat,1}
false

julia> Array{Float64,1} <: AbstractArray{<:AbstractFloat,1}
true

```

---

<div class="post-metadata">

**Author:** ![raphbacher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raphbacher/32/6019_2.png) [@raphbacher](https://discourse.julialang.org/u/raphbacher)\
**Post date:** [March 21, 2019, 12:15am UTC](https://discourse.julialang.org/t/strange-behavior-in-type-system-with-adjoint-and-densearray/22127/3 "2019-03-21T00:15:38Z")

</div>

Thanks for the help ! I had read about this, but it seems I had not fully understand it 🙂  
And I don’t know why I did not try

```julia
Adjoint{Complex{Float64},<:DenseArray{Complex{Float64},1}}

```

(as I wanted to limit to 1d) which indeed works.  
Thanks again !
