# Julia is pointing to a wrong line when an error occur

**URL:** <https://discourse.julialang.org/t/julia-is-pointing-to-a-wrong-line-when-an-error-occur/13314>\
**Category:** General Usage\
**Created:** [August 12, 2018, 5:26pm UTC](https://discourse.julialang.org/t/julia-is-pointing-to-a-wrong-line-when-an-error-occur/13314 "2018-08-12T17:26:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [August 12, 2018, 5:26pm UTC](https://discourse.julialang.org/t/julia-is-pointing-to-a-wrong-line-when-an-error-occur/13314/1 "2018-08-12T17:26:54Z")

</div>

Hi guys,

After updating to Julia v0.7, I am seeing some strange behavior when an error occurs. Julia is saying that the error is occurring in a wrong line. See for example this message:

```julia
julia> include("teste.jl")
[Info: Recompiling stale cache file /Users/ronan.arraes/.julia/compiled/v0.7/MGEO/LkOqr.ji for MGEO [16b43e94-9cbd-11e8-382f-951ad8972bfe]
ERROR: LoadError: setindex!(::StaticArrays.SArray{Tuple{2},Float64,1,2}, value, ::Int) is not defined.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] setindex!(::StaticArrays.SArray{Tuple{2},Float64,1,2}, ::Float64, ::Int64) at /Users/ronan.arraes/.julia/packages/StaticArrays/Ze5H/src/indexing.jl:3
 [3] mgeo_run(::MGEO_Structure{2,2,MGEO.Design_Variable_MGEO_Real}, ::typeof(f_obj4), ::Bool) at /Users/ronan.arraes/tmp/MGEO/src/mgeo_real.jl:90
 [4] top-level scope at util.jl:156
 [5] include at ./boot.jl:317 [inlined]
 [6] include_relative(::Module, ::String) at ./loading.jl:1038
 [7] include(::Module, ::String) at ./sysimg.jl:29
 [8] include(::String) at ./client.jl:398
 [9] top-level scope at none:0
in expression starting at /Users/ronan.arraes/tmp/MGEO/teste.jl:45

```

When I look to line 90 in `mgeo_real.jl`, I see:

```julia
86 @inbounds for run = 1:mgeod.run_max
87 if show_debug
88 println("--------------------------------------------------------------------------------")
89 println("RUN = $run")
90 println("")
91 println("Generations ($ngen_max_per_run):")
92 print(" 0%")
93 end

```

Is it a known bug?

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [August 12, 2018, 10:17pm UTC](https://discourse.julialang.org/t/julia-is-pointing-to-a-wrong-line-when-an-error-occur/13314/2 "2018-08-12T22:17:01Z")

</div>

I failed to find something related to it. Hence, I filed a bug: [Corrupt linenumber in stacktraces for functions with macros · Issue #28618 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/28618)
