-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Not a DefectThis behavior is one of several equally-correct optionsThis behavior is one of several equally-correct options
Description
π Search Terms
Spreading arrays, weak type unions
π Version & Regression Information
Tested with v5.9.2
β― Playground Link
π» Code
declare let a: { foo?: unknown }[]
declare let b: {}[]
let x: { foo?: string }[] = [...a] // doesn't compile, good
let y: { foo?: string }[] = [...a, ...b] // compiles, bad
π Actual behavior
The declaration y
type-checks
π Expected behavior
The declaration y
should not type-check.
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
Not a DefectThis behavior is one of several equally-correct optionsThis behavior is one of several equally-correct options