Hi,
module M
function f{T1}(x::T1) return x.a end
function f{T2}(x::T2) return x.b + 1 end
export f
endusing M type T1 a::Float64 end type T2 b::Float64 end t1 = T1(1.0) t2 = T2(2.0) println(f(t1)) println(f(t2)) This code doesn't work, how can I force the function templated for T1 to be used when calling f(t1)? Many thanks,
