Skip to content

Commit

Permalink
Ensure function has same method as defined
Browse files Browse the repository at this point in the history
  • Loading branch information
mmiller-max committed Jan 6, 2021
1 parent f5ece5a commit c0f1959
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
function $funcName(args...)::$returnType
return get!($cacheName, args) do
$internalFuncName(args...)
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 c0f1959

Please sign in to comment.