Closed
Description
Code
const x = [1, [[2]]];
const y: never = x.flat();
Expected behavior:
I expect the following error:
Type '(1 | [2])[]' is not assignable to type 'never'.
or with more general types,
Type '(number | number[])[]' is not assignable to type 'never'.
This should actually be pretty easy to implement by simply unwrapping the array type (see link below).
Actual behavior:
I instead see
Type 'any[]' is not assignable to type 'never'.
Playground Link:
Using the current definitions
What I expect should happen
Related Issues:
None found.
Metadata
Metadata
Assignees
Labels
No labels