Skip to content

Remove destructive methods in tuple type #6325

Closed
@falsandtru

Description

@falsandtru

I think, tuple type should not have destructive methods because these methods break consistency between the interface and actual properties.

  • Array#push
  • Array#pop
  • Array#shift
  • Array#unshift
  • Array#splice
var t: [boolean, number];
t.shift(); // now actual t type is [number]

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions