Invalid redefinition of constant

i have a function where i define inside the following:

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

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

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

julia> function relay(x, y, z)
         funcQ(v) = x + y + z + v
         return funcQ
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?


Yeah actually it worked after I restarted the kernel