# New method defined at REPL not getting called

**URL:** <https://discourse.julialang.org/t/new-method-defined-at-repl-not-getting-called/6454>\
**Category:** General Usage\
**Created:** [October 15, 2017, 11:47pm UTC](https://discourse.julialang.org/t/new-method-defined-at-repl-not-getting-called/6454 "2017-10-15T23:47:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssfrr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ssfrr/32/3736_2.png) [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Post date:** [October 15, 2017, 11:47pm UTC](https://discourse.julialang.org/t/new-method-defined-at-repl-not-getting-called/6454/1 "2017-10-15T23:47:02Z")

</div>

I’m getting some behavior that seems suspiciously like #265, but of course that cannot be.

Basically I’m calling a function, then defining a new method that should catch it, then calling it again, and my new method isn’t being called. Interestingly `@which` shows my new method.

MWE:

```nohighlight
julia> using FixedPointNumbers

julia> reinterpret(Fixed{Int16, 15}, 0xf123)
ERROR: bitcast: target type not a leaf primitive type
Stacktrace:
 [1] reinterpret(::Type{FixedPointNumbers.Fixed{Int16,15}}, ::UInt16) at ./essentials.jl:155
julia> function Base.reinterpret(::Type{Fixed{T,f}}, x::Unsigned) where {T <: Signed,f}
           reinterpret(Fixed{T, f}, reinterpret(T, x))
       end

julia> reinterpret(Fixed{Int16, 15}, 0xf123)
ERROR: bitcast: target type not a leaf primitive type
Stacktrace:
 [1] reinterpret(::Type{FixedPointNumbers.Fixed{Int16,15}}, ::UInt16) at ./essentials.jl:155

julia> @which reinterpret(Fixed{Int16, 15}, 0xf123)
reinterpret(::Type{FixedPointNumbers.Fixed{T,f}}, x::Unsigned) where {T<:Signed, f} in Main at REPL[3]:2

```

You can see below that if I define my method before I call it, it’s OK:

```nohighlight
julia> using FixedPointNumbers

julia> function Base.reinterpret(::Type{Fixed{T,f}}, x::Unsigned) where {T <: Signed,f}
           reinterpret(Fixed{T, f}, reinterpret(T, x))
       end

julia> reinterpret(Fixed{Int16, 15}, 0xf123)
-0.11612Q0f15

```

Any clues what’s going on?
