# Mysterious Subtyping

**URL:** <https://discourse.julialang.org/t/mysterious-subtyping/13825>\
**Category:** General Usage\
**Tags:** question\
**Created:** [August 21, 2018, 12:37pm UTC](https://discourse.julialang.org/t/mysterious-subtyping/13825 "2018-08-21T12:37:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![1115](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1115/32/4465_2.png) [@1115](https://discourse.julialang.org/u/1115)\
**Post date:** [August 21, 2018, 12:37pm UTC](https://discourse.julialang.org/t/mysterious-subtyping/13825/1 "2018-08-21T12:37:28Z")

</div>

I have an abstract parent type `PrimitiveBlock` from package `Yao.jl`

In another package `QuAlgorithmZoo.jl` that depend on `Yao.jl` I defined a new type

```julia
struct QFTBlock{N} <: PrimitiveBlock{N,ComplexF64} end

```

Now I am using `QuAlgorithmZoo` like

```julia
using Yao
using Yao.Blocks
using QuAlgorithmZoo: QFTBlock

println(supertype(QFTBlock))

```

It will print `Yao.Blocks.PrimitiveBlock{N,Complex{Float64}} where N` just as expected.

But!

```julia
QFTBlock <: Yao.Blocks.PrimitiveBlock

```

will return **false**! why?

Note:

- appear in both julia0.7 and julia1.0
- I can not repeat this bug on another laptop.

---

<div class="post-metadata">

**Author:** ![1115](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1115/32/4465_2.png) [@1115](https://discourse.julialang.org/u/1115)\
**Post date:** [August 21, 2018, 1:59pm UTC](https://discourse.julialang.org/t/mysterious-subtyping/13825/2 "2018-08-21T13:59:07Z")

</div>

It is related to keeping multiple version of same package `Yao.jl`, especially when developing multiple packages at the same time. Julia’s package loading is working in a wield way.
