• 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": "TSUnionType",
14              "types": [
15                {
16                  "type": "TSTupleType",
17                  "elementTypes": [
18                    {
19                      "type": "TSNumberKeyword",
20                      "loc": {
21                        "start": {
22                          "line": 17,
23                          "column": 9
24                        },
25                        "end": {
26                          "line": 17,
27                          "column": 16
28                        }
29                      }
30                    },
31                    {
32                      "type": "TSNumberKeyword",
33                      "loc": {
34                        "start": {
35                          "line": 17,
36                          "column": 17
37                        },
38                        "end": {
39                          "line": 17,
40                          "column": 24
41                        }
42                      }
43                    }
44                  ],
45                  "loc": {
46                    "start": {
47                      "line": 17,
48                      "column": 8
49                    },
50                    "end": {
51                      "line": 17,
52                      "column": 24
53                    }
54                  }
55                },
56                {
57                  "type": "TSTupleType",
58                  "elementTypes": [
59                    {
60                      "type": "TSNumberKeyword",
61                      "loc": {
62                        "start": {
63                          "line": 17,
64                          "column": 28
65                        },
66                        "end": {
67                          "line": 17,
68                          "column": 35
69                        }
70                      }
71                    },
72                    {
73                      "type": "TSNumberKeyword",
74                      "loc": {
75                        "start": {
76                          "line": 17,
77                          "column": 36
78                        },
79                        "end": {
80                          "line": 17,
81                          "column": 43
82                        }
83                      }
84                    },
85                    {
86                      "type": "TSNumberKeyword",
87                      "loc": {
88                        "start": {
89                          "line": 17,
90                          "column": 44
91                        },
92                        "end": {
93                          "line": 17,
94                          "column": 51
95                        }
96                      }
97                    }
98                  ],
99                  "loc": {
100                    "start": {
101                      "line": 17,
102                      "column": 27
103                    },
104                    "end": {
105                      "line": 17,
106                      "column": 51
107                    }
108                  }
109                }
110              ],
111              "loc": {
112                "start": {
113                  "line": 17,
114                  "column": 8
115                },
116                "end": {
117                  "line": 17,
118                  "column": 51
119                }
120              }
121            },
122            "decorators": [],
123            "loc": {
124              "start": {
125                "line": 17,
126                "column": 5
127              },
128              "end": {
129                "line": 17,
130                "column": 6
131              }
132            }
133          },
134          "init": {
135            "type": "ArrayExpression",
136            "elements": [
137              {
138                "type": "NumberLiteral",
139                "value": 1,
140                "loc": {
141                  "start": {
142                    "line": 17,
143                    "column": 55
144                  },
145                  "end": {
146                    "line": 17,
147                    "column": 56
148                  }
149                }
150              }
151            ],
152            "loc": {
153              "start": {
154                "line": 17,
155                "column": 54
156              },
157              "end": {
158                "line": 17,
159                "column": 57
160              }
161            }
162          },
163          "loc": {
164            "start": {
165              "line": 17,
166              "column": 5
167            },
168            "end": {
169              "line": 17,
170              "column": 57
171            }
172          }
173        }
174      ],
175      "kind": "var",
176      "loc": {
177        "start": {
178          "line": 17,
179          "column": 1
180        },
181        "end": {
182          "line": 17,
183          "column": 58
184        }
185      }
186    }
187  ],
188  "loc": {
189    "start": {
190      "line": 1,
191      "column": 1
192    },
193    "end": {
194      "line": 17,
195      "column": 58
196    }
197  }
198}
199TypeError: Type '[1]' is not assignable to type '[number, number] | [number, number, number]'. [tupleAssignability21.ts:17:5]
200