Skip to content

better error message for e.g. convert(Tuple{NTuple{2, Int}, Int}, (3,3,3)) #36573

@goretkin

Description

@goretkin

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}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions