Even smaller repro:
Seems to be related to bounded `TypeVar`
Not specifying `K` or make it not bounded makes the problem disappers.
```julia
function find_tvar3{T<:Tuple}(sig::Type{T})
println(1)
find_tvar3(sig.parameters[1])
end
function find_tvar3(arg::DataType)
println(2)
if arg <: Tuple
error("Dispatch error!")
end
end
K = TypeVar(:K, true)
fm = Tuple{Type{Dict{K}}}
println("First time")
find_tvar3(fm)
println("Second time")
find_tvar3(fm)
```
Output:
```
yuyichao% JULIA_LOAD_PATH=${PWD}/.. julia -f runtests.jl
First time
1
2
Second time
2
ERROR: LoadError: Dispatch error!
in find_tvar3 at /home/yuyichao/projects/mirrors/Traits.jl/runtests.jl:10
in include_from_node1 at ./loading.jl:134
while loading /home/yuyichao/projects/mirrors/Traits.jl/runtests.jl,
in expression
starting on line 20
```
Looks like a bug and probably worth a bug report.