I tested your code in 0.2.1 and get the same result as you. On Version
0.3.0-rc1+279 (2014-07-30 05:54 UTC) I get what you expected, so likely
this is a bug that has been fixed on master.
If you can't code around this issue, you will have to upgrade to 0.3-rc1
(or the nightlies), which is probably a good thing to do anyway.
kl. 08:45:46 UTC+2 mandag 4. august 2014 skrev Philippe Maincon følgende:
>
> Hi there,
>
> I expect the code (yes, still playing around with automatic
> differentiation...)
>
> immutable Dual{T,ndim}
>
> x :: T
>
> dx :: Array{T,ndim}
>
> end
>
>
> function di(a,s)
>
> b = zeros(s...)
>
> return Dual(a,b)
>
> # return Dual(a,[a]) # works as expected
>
> end
>
>
> c = di(3.,(2,3))
>
> typeof(c)
>
> to print
>
> Dual{Float64,2}
>
> But in Julia 0.2 (I believe. What I use for sure is Julia Studio 0.4.4 on
> a 64 bit Windows 7 PC) it returns
>
> Nothing (constructor with 1 method)
>
> which I find peeving. Note the line I commented out: if I uncomment it
> and comment the preceding one, I get the expected behaviour.
>
> What did I miss?
>
> Philippe
>
>