Skip to content

Unable to destructure TypedArrays #20623

@miklossuveges

Description

@miklossuveges

TypeScript Version: 2.6.2

Code

const [ foo, bar ] = new Float64Array([42, -42])

Expected behavior:
foo and bar are destructured correctly
All JS engine with support for TypedArrays and destructuring handles this code without any problem

Actual behavior:
Error: error TS2461: Type 'Float64Array' is not an array type.

Metadata

Metadata

Assignees

Labels

CommittedThe team has roadmapped this issueSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions