Thank you for the code and the pull request link. Very interesting.
On Tuesday, April 7, 2015 at 8:55:34 PM UTC+2, Mauro wrote:
>
> In 0.3 it's not possible in 0.4 this works:
>
> julia> type A{T,P}
> a::T
> end
>
> julia> typealias B{T} A{T, 1}
> A{T,1}
>
> julia> call{T}(::Type{B}, a::T) = B{T}(a)
> call (generic function with 936 methods)
>
> julia> B(1.0)
> A{Float64,1}(1.0)
>
> See https://github.com/JuliaLang/julia/pull/8712 for discussion
> call-overloading.
>
> On Tue, 2015-04-07 at 20:26, Kristoffer Carlsson <[email protected]
> <javascript:>> wrote:
> > Let's say I have a type parameterized with two other types and I do the
> > following:
> >
> > type A{T,P}
> > a::T
> > end
> >
> > typealias B{T} A{T, 1}
> >
> > B(1.0) # Error
> >
> > B{Float64}(1.0) # Works
> >
> > Is there anyway you could write the code so that the T type is inferred
> > from the argument to the call to B.
> >
> > Best regards,
> > Kristoffer Carlsson
>
>