# Dispatching on the result of unwrap\_unionall seems weird?

**URL:** <https://discourse.julialang.org/t/dispatching-on-the-result-of-unwrap-unionall-seems-weird/25677>\
**Category:** General Usage\
**Created:** [June 26, 2019, 5:31am UTC](https://discourse.julialang.org/t/dispatching-on-the-result-of-unwrap-unionall-seems-weird/25677 "2019-06-26T05:31:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marius311](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marius311/32/3953_2.png) [@marius311](https://discourse.julialang.org/u/marius311)\
**Post date:** [June 26, 2019, 5:31am UTC](https://discourse.julialang.org/t/dispatching-on-the-result-of-unwrap-unionall-seems-weird/25677/1 "2019-06-26T05:31:22Z")

</div>

I’m pretty confused about the following dispatch behavior (Julia 1.1 and 1.2pre):

```julia
julia> foo(::Type{V}) where {V<:Vector} = @isdefined(V)
foo (generic function with 1 method)

julia> foo(Base.unwrap_unionall(Vector))
false

```

How can it be that we dispatch to `foo`, hence we’ve verified that `V<:Vector`, while simultaneously “not knowing what `V` is” since `@isdefined(V)` returns false?

This example seems fairly contrived, although I think its not hard to run into the effects of this (as I did) if you’re implementing custom printing for your types via e.g. specializing `Base.show(io::IO, ::Type{MyType{Bar,Baz}}) where {Bar,Baz}`, where you’ll get errors because `Bar` and `Baz` aren’t defined for the same reason as above.
