JuliaCollections / Memoize.jl

@memoize macro for Julia
Other
177 stars 22 forks source link

Vararg functions #40

Closed gmoutsin closed 4 years ago

gmoutsin commented 5 years ago
@memoize function test(a::Vararg{Int})
    return length(a)
end

test(1,2)

gives

TypeError: test: in typeassert, expected Vararg{Int64,N} where N, got Tuple{Int64,Int64}

I guess the problem is that Tuple{Int64,Int64} is not considered a subtype of Vararg{Int64,N} where N. I appreciate this is probably a problem that can only be solved by changing the type system, but I thought I should report it here too.

kmsquire commented 4 years ago

Duplicate of #26 (which @gmoutsin also opened).

Memoize.jl has been mostly unmaintained the last few years. I just started poking at it (because I wanted to use it). No promises, but I'll see what I can do unless/until someone else steps up (which seems somewhat unlikely).