This can't work because it would not, for instance, make sense to use 
module `M` independently. You could use the parent module from `M`, but as 
it stands that won't work either because loading the parent module will try 
to use `f` from `M`. What are you trying to do?

On Monday, June 20, 2016 at 8:06:11 AM UTC-4, [email protected] wrote:
>
> Hi,
>
> module M
> function f{T1}(x::T1) return x.a end
> function f{T2}(x::T2) return x.b + 1 end
> export f
> end
>
> using 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,
>

Reply via email to