้•œๅƒ็ซ™็‚น ยท ๆœฌ้กต็”ฑ็ฌฌไธ‰ๆ–น GitHub ๅช่ฏป้•œๅƒๆไพ›๏ผŒ้ž GitHub ๅฎ˜ๆ–น็ซ™็‚น๏ผŒไธๆŽฅๅ—ไปปไฝ•็™ปๅฝ•ๆˆ–ๅ‡ญๆฎ่พ“ๅ…ฅใ€‚ๅ‰ๅพ€ github.com
Skip to content

Variadic tuple with any[] spread incorrectly assignable to shorter variadic tuple targetย #50216

Description

Bug Report

๐Ÿ”Ž Search Terms

variadic, tuple, any, assignable

๐Ÿ•— Version & Regression Information

  • This changed between versions 4.1.5 and 4.2.x, it's probably a regression from this PR

โฏ Playground Link

Playground link with relevant code

๐Ÿ’ป Code

declare let tt3: [number, string, ...any[]];
let tt4: [number, ...number[]] = tt3; // it should error

const el = tt4[1]
//    ^? number
tt4[1] = tt3[1] // this errors correctly

๐Ÿ™ Actual behavior

Unsound assignment is incorrectly allowed

๐Ÿ™‚ Expected behavior

It should be a type error

Activity

  1. locked as resolved and limited conversation to collaborators on Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions