• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  "type": "Program",
3  "statements": [
4    {
5      "type": "VariableDeclaration",
6      "declarations": [
7        {
8          "type": "VariableDeclarator",
9          "id": {
10            "type": "Identifier",
11            "name": "a",
12            "typeAnnotation": {
13              "type": "TSTupleType",
14              "elementTypes": [
15                {
16                  "type": "TSNumberKeyword",
17                  "loc": {
18                    "start": {
19                      "line": 17,
20                      "column": 9
21                    },
22                    "end": {
23                      "line": 17,
24                      "column": 16
25                    }
26                  }
27                },
28                {
29                  "type": "TSStringKeyword",
30                  "loc": {
31                    "start": {
32                      "line": 17,
33                      "column": 17
34                    },
35                    "end": {
36                      "line": 17,
37                      "column": 24
38                    }
39                  }
40                }
41              ],
42              "loc": {
43                "start": {
44                  "line": 17,
45                  "column": 8
46                },
47                "end": {
48                  "line": 17,
49                  "column": 24
50                }
51              }
52            },
53            "decorators": [],
54            "loc": {
55              "start": {
56                "line": 17,
57                "column": 5
58              },
59              "end": {
60                "line": 17,
61                "column": 6
62              }
63            }
64          },
65          "init": {
66            "type": "ArrayExpression",
67            "elements": [
68              {
69                "type": "NumberLiteral",
70                "value": 5,
71                "loc": {
72                  "start": {
73                    "line": 17,
74                    "column": 28
75                  },
76                  "end": {
77                    "line": 17,
78                    "column": 29
79                  }
80                }
81              },
82              {
83                "type": "StringLiteral",
84                "value": "foo",
85                "loc": {
86                  "start": {
87                    "line": 17,
88                    "column": 31
89                  },
90                  "end": {
91                    "line": 17,
92                    "column": 36
93                  }
94                }
95              },
96              {
97                "type": "NumberLiteral",
98                "value": 6,
99                "loc": {
100                  "start": {
101                    "line": 17,
102                    "column": 38
103                  },
104                  "end": {
105                    "line": 17,
106                    "column": 39
107                  }
108                }
109              }
110            ],
111            "loc": {
112              "start": {
113                "line": 17,
114                "column": 27
115              },
116              "end": {
117                "line": 17,
118                "column": 40
119              }
120            }
121          },
122          "loc": {
123            "start": {
124              "line": 17,
125              "column": 5
126            },
127            "end": {
128              "line": 17,
129              "column": 40
130            }
131          }
132        }
133      ],
134      "kind": "var",
135      "loc": {
136        "start": {
137          "line": 17,
138          "column": 1
139        },
140        "end": {
141          "line": 17,
142          "column": 41
143        }
144      }
145    }
146  ],
147  "loc": {
148    "start": {
149      "line": 1,
150      "column": 1
151    },
152    "end": {
153      "line": 17,
154      "column": 41
155    }
156  }
157}
158TypeError: Type '[5, "foo", 6]' is not assignable to type '[number, string]'. [tupleAssignability2.ts:17:5]
159