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