Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type inference should also be correct for more than a two-dimensional array. #789

Open
blacktoast opened this issue Mar 5, 2023 · 0 comments

Comments

@blacktoast
Copy link
Contributor

In this case:

let a= [[2]];
 a; 

The TSC infers this case to be let a: number[][], link
but the current STC infers

  x Type
   ,-[$DIR/tests/pass/vars/typeAnn/tuple/2.ts:1:1]
 1 | let a = [[1]];
 2 | a;
   : ^
   `----

Error: 
  > [number][]

in my opinion, it should be inferred like TSC for more than two-dimensional arrays.

@kdy1 kdy1 added this to the v0.0.1: Correctness milestone Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants