# Add cross-references \`\[\`foo\`\](@ref)\` to functions with same name but different arguments

**URL:** <https://discourse.julialang.org/t/add-cross-references-foo-ref-to-functions-with-same-name-but-different-arguments/17113>\
**Category:** General Usage\
**Tags:** documentation\
**Created:** [November 3, 2018, 10:42am UTC](https://discourse.julialang.org/t/add-cross-references-foo-ref-to-functions-with-same-name-but-different-arguments/17113 "2018-11-03T10:42:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zygmuntszpak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zygmuntszpak/32/2591_2.png) [@zygmuntszpak](https://discourse.julialang.org/u/zygmuntszpak)\
**Post date:** [November 3, 2018, 10:42am UTC](https://discourse.julialang.org/t/add-cross-references-foo-ref-to-functions-with-same-name-but-different-arguments/17113/1 "2018-11-03T10:42:20Z")

</div>

Hi all,

When writing documentation for a function, is it possible to create cross-references (i.e. `@ref`) to functions that have the same name but different dispatch signature? Below is a simplified example of what I have in mind.

```julia
struct TypeOne end
struct TypeTwo end

"""
function foo(TypeOne())

Function performs operation foo. 
See also: [`foo`](@ref) # Would like this to link to foo(::TypeTwo)
"""
function foo(mytype::TypeOne)
end

"""
function foo(TypeTwo())

Function performs a variant of operation foo. 
See also: [`foo`](@ref) # Would like this to link to foo(::TypeOne)
"""
function foo(mytype::TypeTwo)
end

```

---

<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:** [November 4, 2018, 2:01am UTC](https://discourse.julialang.org/t/add-cross-references-foo-ref-to-functions-with-same-name-but-different-arguments/17113/2 "2018-11-04T02:01:16Z")

</div>

```julia
struct TypeOne end
struct TypeTwo end

"""
    foo(::TypeOne)

Function performs operation foo.
See also: [`foo`](@ref foo(::TypeTwo))
"""
foo(::TypeOne) = 1

"""
    foo(::TypeTwo)

Function performs operation foo.
See also: [`foo`](@ref foo(::TypeOne))
"""
foo(::TypeTwo) = 2

```

and also make sure to split the docstring of `foo` in the markdown file:

````julia
```@docs
foo(::TypeOne)
foo(::TypeTwo)
```

````
