# Step!() remains strangely unfound if buried inside another method

**URL:** <https://discourse.julialang.org/t/step-remains-strangely-unfound-if-buried-inside-another-method/108316>\
**Category:** General Usage\
**Tags:** question, scope\
**Created:** [January 3, 2024, 8:56pm UTC](https://discourse.julialang.org/t/step-remains-strangely-unfound-if-buried-inside-another-method/108316 "2024-01-03T20:56:13Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [January 4, 2024, 9:47am UTC](https://discourse.julialang.org/t/step-remains-strangely-unfound-if-buried-inside-another-method/108316/4 "2024-01-04T09:47:01Z")

</div>

As Steven said you are shadowing the function - think of it as overwriting the definition, so `step!` is not related to `DynamicalSystems.step!` at all.

Here’s a simple example:

```julia
julia> struct A end

julia> sum(x::A) = 5
sum (generic function with 1 method)

julia> sum(A())
5

julia> sum([1,2,3])
ERROR: MethodError: no method matching sum(::Vector{Int64})
You may have intended to import Base.sum

```

As you see, the `sum` I created there has only 1 method, so there is nothing for multiple dispatch to do. For multiple dispatch to work I’d have import `Base.sum` and extend it, like here (new session):

```julia
julia> struct A end

julia> import Base.sum

julia> Base.sum(x::A) = 5

julia> sum(A())
5

julia> sum([1,2,3])
6

```

---

_[View the full topic](https://discourse.julialang.org/t/step-remains-strangely-unfound-if-buried-inside-another-method/108316)._
