Skip to content

type definitions don't work for tuple types #10

@ajafff

Description

@ajafff
declare let tuple: [number, string];

const arrified = arrify(tuple);
arrified.push(1);
arrified[0] = 'foo'

Since tuples are arrays, they are returned as is. The type declarations however widen the type to a regular (mutable) array type. Both mutations above should not be allowed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions