Hey,
Say i have a tuple type Tuple{A,B}
. How can i index it to ge the n
th type ? I have the following error:
julia> Tuple{Float64,Int64}[1]
ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type Tuple{Float64, Int64}
Closest candidates are:
convert(::Type{T}, ::T) where T<:Tuple at essentials.jl:315
convert(::Type{T}, ::Tuple{Vararg{Any, N}}) where {N, T<:Tuple} at essentials.jl:316
convert(::Type{T}, ::CartesianIndex) where T<:Tuple at multidimensional.jl:137
...
Stacktrace:
[1] setindex!(A::Vector{Tuple{Float64, Int64}}, x::Int64, i1::Int64)
@ Base .\array.jl:839
[2] getindex(#unused#::Type{Tuple{Float64, Int64}}, x::Int64)
@ Base .\array.jl:392
[3] top-level scope
@ REPL[72]:1
julia>
I dont want to instantiate the Tuple type to index a tuple and then get the type.