# Invalid redefinition of constant

**URL:** https://discourse.julialang.org/t/invalid-redefinition-of-constant/54686
**Category:** General Usage
**Created:** [February 5, 2021, 1:49pm UTC](https://discourse.julialang.org/t/invalid-redefinition-of-constant/54686 "2021-02-05T13:49:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![marouane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marouane/32/16267_2.png) [@marouane](https://discourse.julialang.org/u/marouane)
#### Post date: [February 5, 2021, 1:49pm UTC](https://discourse.julialang.org/t/invalid-redefinition-of-constant/54686/1 "2021-02-05T13:49:39Z")

</div>

i have a function where i define inside the following:

```julia
function relay(x,y,z)
block of code

funcQ(v)=qrs.prob(a,v,b)
return funcQ

```

then when i want to call the inner function, this happens  
`funcQ= relay(argument list)`  
i get this message:  
`invalid redefinition of constant funcQ`

---

<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: [February 5, 2021, 2:23pm UTC](https://discourse.julialang.org/t/invalid-redefinition-of-constant/54686/2 "2021-02-05T14:23:02Z")

</div>

I can’t reproduce the error from the code you’ve given. Here’s a simplified version which works just fine:

```julia
julia> function relay(x, y, z)
         funcQ(v) = x + y + z + v
         return funcQ
       end
relay (generic function with 1 method)

julia> funcQ = relay(1, 2, 3)
funcQ (generic function with 1 method)

```

What probably happened is that you defined `function funcQ(...)` earlier in the same Julia session. Does the error persist if you restart Julia?

---

<div class="post-metadata">

### Author: ![marouane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marouane/32/16267_2.png) [@marouane](https://discourse.julialang.org/u/marouane)
#### Post date: [February 5, 2021, 8:53pm UTC](https://discourse.julialang.org/t/invalid-redefinition-of-constant/54686/3 "2021-02-05T20:53:55Z")

</div>

Yeah actually it worked after I restarted the kernel
