Skip to content

Commit

Permalink
Merge pull request #5 from mmiller-max/mm/keep-original-function-methods
Browse files Browse the repository at this point in the history
Ensure function has same method as defined
  • Loading branch information
quinnj authored Jan 15, 2021
2 parents 6647564 + 1c90274 commit f257f67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ExpiringCaches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ macro cacheable(timeout, func)
return esc(quote
const $cacheName = ExpiringCaches.Cache{Tuple{$(argTypes...)}, $returnType}($timeout)
$internalFunction
Base.@__doc__ function $funcName(args...)::$returnType
return get!($cacheName, args) do
$internalFuncName(args...)
Base.@__doc__ function $funcName($(funcArgs...))::$returnType
return get!($cacheName, tuple($(funcArgs...))) do
$internalFuncName($(funcArgs...))
end
end
ExpiringCaches.getcache(f::typeof($funcName)) = $cacheName
Expand Down

0 comments on commit f257f67

Please sign in to comment.