# Local function redefinition: feature or bug?

**URL:** https://discourse.julialang.org/t/local-function-redefinition-feature-or-bug/10158
**Category:** General Usage
**Created:** [April 4, 2018, 1:47pm UTC](https://discourse.julialang.org/t/local-function-redefinition-feature-or-bug/10158 "2018-04-04T13:47:26Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)
#### Post date: [April 4, 2018, 3:16pm UTC](https://discourse.julialang.org/t/local-function-redefinition-feature-or-bug/10158/2 "2018-04-04T15:16:18Z")

</div>

Please [quote your code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530)

This is indeed confusing and is a real change since earlier Julia versions: [https://github.com/JuliaLang/julia/issues/15602#issuecomment-200410836](https://github.com/JuliaLang/julia/issues/15602#issuecomment-200410836)

Fortunately, it’s also very easy to fix by using an anonymous function instead (which will perform just as well):

```julia
julia> function t()
         f = () -> 1
         print(f())
         f = () -> 2
         print(f())
       end
t (generic function with 1 method)

julia> t()
12

```

---

_[View the full topic](https://discourse.julialang.org/t/local-function-redefinition-feature-or-bug/10158)._
