Open bjmtrk opened 8 years ago
It should work, but doesn't... This workaround works:
julia> module X
using Traits
export TR
fun(x)= 1
@traitdef TR{T} begin
fun(T) -> Number
end
end
X
julia> module Y
using Traits
using X
@traitimpl TR{Int64} begin
fun(x::Int64) = 3x
end
end
Maybe an explicit function def should be used? Like so:
julia> module X
using Traits
export TR
function fun end # not sure whether an explicit function-def
@traitdef TR{T} begin
fun(T) -> Number
end
end
But this does not work either. However, in light of https://github.com/JuliaLang/julia/issues/14636, I'm not sure how to implement this.
Hi,
i was trying to do this, but obviously i get the following issue:
How can i do this? Thanks
(Edited by @mauro3: added tripple back-ticks. Also note that with quoting macro I meant enclosing them with back-ticks and not just a single back-tick in front of them.)