Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package documentation #123

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix doctests
  • Loading branch information
omus committed Jul 13, 2024
commit 7ebd7d776dff3e3a70a38d1c02c0c6a9c10b334b
12 changes: 11 additions & 1 deletion src/dispatch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,25 @@ type_morespecific(a, b) = ccall(:jl_type_morespecific, Bool, (Any, Any), a, b)
Construct a Tuple of the methods signature with the function type removed

# Example
```@meta
DocTestSetup = quote
using Mocking: anonymous_signature
end
```

```jldoctest
julia> m = first(methods(first, (String,)));

julia> m.sig
Tuple{typeof(first),Any}
Tuple{typeof(first), Any}

julia> anonymous_signature(m)
Tuple{Any}
```

```@meta
DocTestSetup = nothing
```
"""
anonymous_signature(m::Method) = anonymous_signature(m.sig)
anonymous_signature(sig::DataType) = Tuple{sig.parameters[2:end]...}
Expand Down
Loading