mauro3 / Traits.jl

Exploration of traits in Julia
Other
39 stars 6 forks source link

Cannot have several methods for same generic function #8

Closed mauro3 closed 9 years ago

mauro3 commented 9 years ago
f(x::Int,y::Int) = 1
f(x::Int,y::Float64) = 1
@traitdef TT{X} begin
    f(X, Int)
    f(X, Float64)
end
@assert length(TT{Int}().methods)==2 # length is 1!

does not work as methods stores only on signature per function.

mauro3 commented 9 years ago

Closed with #10