# Duplicated function documentation

**URL:** <https://discourse.julialang.org/t/duplicated-function-documentation/83882>\
**Category:** General Usage\
**Created:** [July 7, 2022, 8:06am UTC](https://discourse.julialang.org/t/duplicated-function-documentation/83882 "2022-07-07T08:06:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hros](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@hros](https://discourse.julialang.org/u/hros)\
**Post date:** [July 7, 2022, 8:06am UTC](https://discourse.julialang.org/t/duplicated-function-documentation/83882/1 "2022-07-07T08:06:17Z")

</div>

The documentation of a function with multiple methods is duplicated.

```julia
"""
doc of f
"""
f(m::AbstractMatrix) = g(m)
f(r::AbstractVector) = g(h(r))

```

searching for the doc of the function

```julia
help?> f

```

results in

```julia
  doc of f
  ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  doc of f

```

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [July 7, 2022, 8:08am UTC](https://discourse.julialang.org/t/duplicated-function-documentation/83882/2 "2022-07-07T08:08:36Z")

</div>

I can’t reproduce this, probably you have attached a docstring to something else called `f` in that same Julia session.

Note also that if you just want to attach the docstring to a function rather than a method you can do

```julia
"""
doc of f
"""
function f end

f(m::AbstractMatrix) = g(m)
f(r::AbstractVector) = g(h(r))

```

for example.

---

<div class="post-metadata">

**Author:** ![hros](https://avatars.discourse-cdn.com/v4/letter/h/97f17d/32.png) [@hros](https://discourse.julialang.org/u/hros)\
**Post date:** [July 7, 2022, 9:05am UTC](https://discourse.julialang.org/t/duplicated-function-documentation/83882/3 "2022-07-07T09:05:24Z")

</div>

I don’t have another symbol with that name. But that does not matter, as your suggestion of adding an empty function solved the problem  
Thanks
