stc icon indicating copy to clipboard operation
stc copied to clipboard

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

Open blacktoast opened this issue 3 years ago • 0 comments

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.

blacktoast avatar Mar 05 '23 04:03 blacktoast