# Nagging coverage question

**URL:** <https://discourse.julialang.org/t/nagging-coverage-question/61821>\
**Category:** General Usage\
**Created:** [May 25, 2021, 10:37pm UTC](https://discourse.julialang.org/t/nagging-coverage-question/61821 "2021-05-25T22:37:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bramtayl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bramtayl/32/3614_2.png) [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Post date:** [May 25, 2021, 10:37pm UTC](https://discourse.julialang.org/t/nagging-coverage-question/61821/1 "2021-05-25T22:37:08Z")

</div>

Ok, so, compare the following two macros:

```julia
macro adds_more_lines_1()
    quote
    nothing
    end
end

```

```julia
macro adds_more_lines_2()
    result = 
        quote
        nothing
        end
    result.args[1] = __source__
    result
end

```

`@adds_more_lines_1` inserts additional lines of code. `@adds_more_lines_2` not only inserts them, but changes the line numbering to point to the call site, rather than the definition site.

Naive experimentation seems to show to me that renumbering lines is necessary if you want filled out stacktraces and accurate coverage results. See [here](https://github.com/JuliaAudio/PortAudio.jl/pull/76) for an example. I’m honestly struggling to formulate my questions about this, but they basically boil down to:

a) Is this actually a good idea? If so, maybe we should mention it in the docs somewhere?  
b) Should this be really necessary? Can coverage just keep tabs on new lines introduced by macros? If not, should renumbering maybe be done automatically as part of macro hygiene?

---

<div class="post-metadata">

**Author:** ![bramtayl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bramtayl/32/3614_2.png) [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Post date:** [May 26, 2021, 1:51pm UTC](https://discourse.julialang.org/t/nagging-coverage-question/61821/2 "2021-05-26T13:51:54Z")

</div>

Ref [Document renumbering lines in macros by bramtayl · Pull Request #40955 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/40955)
