sorry, more confusion...  why doesn't this work?

julia> Tuple{Int}(1)
ERROR: MethodError: `convert` has no method matching convert(::Type{Tuple{
Int64}}, ::Int64)
This may have arisen from a call to the constructor Tuple{Int64}(...),
since type constructors fall back to convert methods.
Closest candidates are:
  call{T}(::Type{T}, ::Any)
  convert{T<:Tuple{Any,Vararg{Any}}}(::Type{T<:Tuple{Any,Vararg{Any}}}, ::T
<:Tuple{Any,Vararg{Any}})
  convert{T<:Tuple{Any,Vararg{Any}}}(::Type{T<:Tuple{Any,Vararg{Any}}}, ::
Tuple{Any,Vararg{Any}})
  ...
 in call at essentials.jl:56

this does:

julia> immutable Tuple2{A,B}
         a::A
         b::B
       end

julia> Tuple2{Int,Int}(1,2)
Tuple2{Int64,Int64}(1,2)

and the docs at https://julia.readthedocs.org/en/latest/manual/types/ seem 
to imply that's how Tuple should work too.

thanks,
andrew

Reply via email to