• 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": "TSStringKeyword",
58                  "loc": {
59                    "start": {
60                      "line": 17,
61                      "column": 27
62                    },
63                    "end": {
64                      "line": 17,
65                      "column": 33
66                    }
67                  }
68                }
69              ],
70              "loc": {
71                "start": {
72                  "line": 17,
73                  "column": 8
74                },
75                "end": {
76                  "line": 17,
77                  "column": 33
78                }
79              }
80            },
81            "decorators": [],
82            "loc": {
83              "start": {
84                "line": 17,
85                "column": 5
86              },
87              "end": {
88                "line": 17,
89                "column": 6
90              }
91            }
92          },
93          "init": {
94            "type": "NumberLiteral",
95            "value": 5,
96            "loc": {
97              "start": {
98                "line": 17,
99                "column": 36
100              },
101              "end": {
102                "line": 17,
103                "column": 37
104              }
105            }
106          },
107          "loc": {
108            "start": {
109              "line": 17,
110              "column": 5
111            },
112            "end": {
113              "line": 17,
114              "column": 37
115            }
116          }
117        }
118      ],
119      "kind": "var",
120      "loc": {
121        "start": {
122          "line": 17,
123          "column": 1
124        },
125        "end": {
126          "line": 17,
127          "column": 38
128        }
129      }
130    }
131  ],
132  "loc": {
133    "start": {
134      "line": 1,
135      "column": 1
136    },
137    "end": {
138      "line": 17,
139      "column": 38
140    }
141  }
142}
143TypeError: Type 'number' is not assignable to type '[number, number] | string'. [tupleAssignability22.ts:17:5]
144