# How a ghost variable never appear but always reported not defined

**URL:** https://discourse.julialang.org/t/how-a-ghost-variable-never-appear-but-always-reported-not-defined/34630
**Category:** General Usage
**Tags:** question
**Created:** [February 14, 2020, 3:08pm UTC](https://discourse.julialang.org/t/how-a-ghost-variable-never-appear-but-always-reported-not-defined/34630 "2020-02-14T15:08:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [February 14, 2020, 3:08pm UTC](https://discourse.julialang.org/t/how-a-ghost-variable-never-appear-but-always-reported-not-defined/34630/1 "2020-02-14T15:08:35Z")

</div>

There is no variable ‘A’ applied or assigned anywhere in this function. With multiple reboost of my laptop and atom, there is still the error report:  
‘A not defined’. I really cannot fight against a ghost. Do anyone know what’s happening?

PS: I traced along every function called in this execution and ensured no ‘A’ variable anywhere at all.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/8/18d2436445e71eaac8618478a318961a23149121.png)

---

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [February 14, 2020, 3:19pm UTC](https://discourse.julialang.org/t/how-a-ghost-variable-never-appear-but-always-reported-not-defined/34630/2 "2020-02-14T15:19:24Z")

</div>

Solved by matching the column dimension of original D[f] with the x assigned to D[f] for updating. But the error report really swerved me to bush 😢.

---

<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: [February 14, 2020, 6:18pm UTC](https://discourse.julialang.org/t/how-a-ghost-variable-never-appear-but-always-reported-not-defined/34630/3 "2020-02-14T18:18:18Z")

</div>

The inner-most call in the stack is in `LazyArrays`, and is [this line](https://github.com/JuliaArrays/LazyArrays.jl/blob/a65be5fc981018b000f0ccdfff9a60244b1ccf46/src/lazyconcat.jl#L141), which is displaying an error message. It includes the interpolated expression `$(map(x->size(x,2), A))`, but `A` doesn’t exist. It should probably be `a` instead.

Probably worth a bug report to LazyArrays.
