# Weird bug that shouldn't happen; Cannot declare anonymous.#XX#XX constant; it already has a value

**URL:** <https://discourse.julialang.org/t/weird-bug-that-shouldnt-happen-cannot-declare-anonymous-xx-xx-constant-it-already-has-a-value/133989>\
**Category:** General Usage\
**Tags:** bug, debug, anonymous-function, infiltrator\
**Created:** [November 19, 2025, 12:42pm UTC](https://discourse.julialang.org/t/weird-bug-that-shouldnt-happen-cannot-declare-anonymous-xx-xx-constant-it-already-has-a-value/133989 "2025-11-19T12:42:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qfl3x](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qfl3x/32/16227_2.png) [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Post date:** [November 19, 2025, 12:42pm UTC](https://discourse.julialang.org/t/weird-bug-that-shouldnt-happen-cannot-declare-anonymous-xx-xx-constant-it-already-has-a-value/133989/1 "2025-11-19T12:42:29Z")

</div>

I was just playing around in Infiltrator and stumbled on this:

 ![Screenshot_20251119_134050](https://global.discourse-cdn.com/julialang/original/3X/1/a/1a329a3d8503b075a0a054170ec6520e30f9bae0.png)

Shouldn’t this be impossible?

I have 2 other anonymous functions used in the script. Probably dozens if not hundreds in the packages I’m `using`.  
Couldn’t reproduce it.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [November 19, 2025, 2:43pm UTC](https://discourse.julialang.org/t/weird-bug-that-shouldnt-happen-cannot-declare-anonymous-xx-xx-constant-it-already-has-a-value/133989/2 "2025-11-19T14:43:16Z")

</div>

> [@Qfl3x](#):
>
> Couldn’t reproduce it.

It’s hard for anyone to help if you don’t give runnable code with a reproducible example.

As a general comment, a lot of non-reproducible weird errors occur when people run in a Julia environment that they broke somehow, e.g. by redefining some `Base` function. So they disappear when you restart Julia and run the same code in a clean process.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [November 19, 2025, 2:58pm UTC](https://discourse.julialang.org/t/weird-bug-that-shouldnt-happen-cannot-declare-anonymous-xx-xx-constant-it-already-has-a-value/133989/3 "2025-11-19T14:58:28Z")

</div>

In this particular case, I wouldn’t be surprised if it’s an Infiltrator.jl bug in how it sets up its temporary `anonymous` module (which is distinct from the concept of an anonymous function).

Edit: looks like [Redefining Functions\* Results in Error · Issue #83 · JuliaDebug/Infiltrator.jl · GitHub](https://github.com/JuliaDebug/Infiltrator.jl/issues/83), in fact.
