SimpleTraits.jl icon indicating copy to clipboard operation
SimpleTraits.jl copied to clipboard

@traitfn with multiple traits

Open ChenZhao44 opened this issue 1 year ago • 0 comments

I am trying to define a method with arguments of multiple traits.

using SimpleTraits
@traitdef Foo{T}
@traitdef Bar{T}

@traitfn f(::S, ::T) where {S, T; Foo{S}, Bar{T}} = nothing

I expect the macro @traitfn will generate a method like

f(::Type{Foo{S}}, ::Type{Bar{T}}, ::S, ::T) where {S, T}

However, it only generated

f(::Type{Foo{S}}, ::S, ::T) where {S, T}

Please correct me if my understanding on trait is wrong.

ChenZhao44 avatar Oct 05 '23 19:10 ChenZhao44