# \[SOLVED\] Unexpected dispatch behavior

**URL:** https://discourse.julialang.org/t/solved-unexpected-dispatch-behavior/92307
**Category:** New to Julia
**Created:** [December 30, 2022, 8:06am UTC](https://discourse.julialang.org/t/solved-unexpected-dispatch-behavior/92307 "2022-12-30T08:06:38Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![fatteneder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatteneder/32/33991_2.png) [@fatteneder](https://discourse.julialang.org/u/fatteneder)
#### Post date: [December 30, 2022, 9:49am UTC](https://discourse.julialang.org/t/solved-unexpected-dispatch-behavior/92307/2 "2022-12-30T09:49:41Z")

</div>

Please provide a Minimal Working Example (MWE) so that we can run the code and see where it is going wrong. The code you gave is using undefined types and functions, in particular the following are missing:

- `Empty`
- `WithinLength`
- `isfull`
- `_next_circ_idx`

You might also want to read: [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757)

Anyways, if I define some of the missing pieces like

```julia
struct Empty{T} <: FillingLevel end
struct WithinLength{T} <: FillingLevel end
isfull(cb::CircularBuffer) = cb.tail >= length(cb.queue)-1

```

I get the following error

```julia
julia> push!(cb1,3,4,5)
ERROR: UndefVarError: _next_circ_idx not defined
Stacktrace:
 [1] _push!(::CircularBuffer{Int64}, ::Int64, ::Vararg{Int64})
   @ Main ~/wd/scratch/julia/mwe_bombusfragrans.jl:123
...

```

In the bits of code I have from you `_next_circ_idx` only appears in the definition of `_push`, so to me it seems to work correctly.  
Maybe just try to restart the REPL and run your script again?

---

_[View the full topic](https://discourse.julialang.org/t/solved-unexpected-dispatch-behavior/92307)._
