You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The convert methods are defined using the structural recursion on tuples, so the error message comes from a nested call:
julia>convert(Tuple{NTuple{2, Int}, Int}, (3,3,3))
ERROR: MethodError: Cannot `convert` an object of type Int64 to an object of type Tuple{Int64,Int64}
It might be better to produce the following error message, if possible. ERROR: MethodError: Cannot `convert` an object of type Tuple{Int64,Int64,Int64} to an object of type Tuple{Tuple{Int64,Int64},Int64}
The text was updated successfully, but these errors were encountered:
I'd attempted this in #32427, but had gotten hung up on a type-system bug that made it segfault when I tried to detect this case. I think I've found a workaround.
julia> convert(Tuple{NTuple{2, Int}, Int}, (3,3,3))
ERROR: MethodError: Cannot `convert` an object of type
Tuple{Int64,Int64{},Int64} to an object of type
Tuple{Tuple{Int64, Int64},Int64{}}
The
convert
methods are defined using the structural recursion on tuples, so the error message comes from a nested call:It might be better to produce the following error message, if possible.
ERROR: MethodError: Cannot `convert` an object of type Tuple{Int64,Int64,Int64} to an object of type Tuple{Tuple{Int64,Int64},Int64}
The text was updated successfully, but these errors were encountered: