We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
MWE:
using Dates using ExpiringCaches @cacheable Second(10) function foo(arg1::Int)::Int64 sleep(5.0) return arg1 end
Calling the function with the wrong arguments gives this:
julia> foo(1.0) ERROR: MethodError: no method matching get(::Cache{Tuple{Int64},Int64,Second}, ::Tuple{Float64}, ::Symbol) Closest candidates are: get(::REPL.Terminals.TTYTerminal, ::Any, ::Any) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/REPL/src/Terminals.jl:161 get(::IdDict{K,V}, ::Any, ::Any) where {K, V} at iddict.jl:86 get(::Base.Iterators.Pairs, ::Any, ::Any) at iterators.jl:252 ... Stacktrace: [1] in(::Tuple{Float64}, ::Base.KeySet{Tuple{Int64},Cache{Tuple{Int64},Int64,Second}}) at ./abstractdict.jl:65 [2] haskey(::Cache{Tuple{Int64},Int64,Second}, ::Tuple{Float64}) at ./abstractdict.jl:17 [3] get!(::var"#9#10"{Tuple{Float64}}, ::Cache{Tuple{Int64},Int64,Second}, ::Tuple{Float64}) at ./abstractdict.jl:504 [4] foo(::Float64) at /Users/malmiller/repos/ExpiringCaches.jl/src/ExpiringCaches.jl:169 [5] top-level scope at REPL[5]:1
Rather than
julia> foo(1.0) ERROR: MethodError: no method matching foo(::Float64) Closest candidates are: foo(::Int64) at REPL[5]:1 Stacktrace: [1] top-level scope at REPL[4]:1
I think this will also mean that functions where only 1 method is @cacheable may not work correctly as foo(args...) has been defined.
@cacheable
foo(args...)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
MWE:
Calling the function with the wrong arguments gives this:
Rather than
I think this will also mean that functions where only 1 method is
@cacheable
may not work correctly asfoo(args...)
has been defined.The text was updated successfully, but these errors were encountered: