julia> using SimpleTraits
julia> @traitdef Tr{Array}
julia> @traitfn fn(x::X) where {X<:Vector; Tr{X}} = 4
fn (generic function with 2 methods)
julia> @traitimpl Tr{Vector{Int}}
julia> fn([1,2,3])
4
julia> fn([1.0,2.0,3.0])
ERROR: MethodError: no method matching fn(::Type{Not{Tr{Array{Float64,1}}}}, ::Array{Float64,1})
Closest candidates are:
fn(::Type{Tr{X<:(Array{T,1} where T)}}, ::X<:(Array{T,1} where T)) where X<:(Array{T,1} where T) at /Users/gnimuc/.julia/packages/SimpleTraits/CZOA2/src/SimpleTraits.jl:332
Stacktrace:
[1] fn(::Array{Float64,1}) at /Users/gnimuc/.julia/packages/SimpleTraits/CZOA2/src/SimpleTraits.jl:350
[2] top-level scope at none:0