• 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": "func",
11          "decorators": [],
12          "loc": {
13            "start": {
14              "line": 17,
15              "column": 10
16            },
17            "end": {
18              "line": 17,
19              "column": 14
20            }
21          }
22        },
23        "generator": false,
24        "async": false,
25        "expression": false,
26        "params": [
27          {
28            "type": "Identifier",
29            "name": "a",
30            "typeAnnotation": {
31              "type": "TSNumberKeyword",
32              "loc": {
33                "start": {
34                  "line": 17,
35                  "column": 19
36                },
37                "end": {
38                  "line": 17,
39                  "column": 25
40                }
41              }
42            },
43            "optional": true,
44            "decorators": [],
45            "loc": {
46              "start": {
47                "line": 17,
48                "column": 15
49              },
50              "end": {
51                "line": 17,
52                "column": 16
53              }
54            }
55          },
56          {
57            "type": "RestElement",
58            "argument": {
59              "type": "Identifier",
60              "name": "c",
61              "typeAnnotation": {
62                "type": "TSArrayType",
63                "elementType": {
64                  "type": "TSStringKeyword",
65                  "loc": {
66                    "start": {
67                      "line": 17,
68                      "column": 33
69                    },
70                    "end": {
71                      "line": 17,
72                      "column": 39
73                    }
74                  }
75                },
76                "loc": {
77                  "start": {
78                    "line": 17,
79                    "column": 33
80                  },
81                  "end": {
82                    "line": 17,
83                    "column": 41
84                  }
85                }
86              },
87              "decorators": [],
88              "loc": {
89                "start": {
90                  "line": 17,
91                  "column": 30
92                },
93                "end": {
94                  "line": 17,
95                  "column": 31
96                }
97              }
98            },
99            "loc": {
100              "start": {
101                "line": 17,
102                "column": 27
103              },
104              "end": {
105                "line": 17,
106                "column": 31
107              }
108            }
109          }
110        ],
111        "body": {
112          "type": "BlockStatement",
113          "statements": [],
114          "loc": {
115            "start": {
116              "line": 17,
117              "column": 43
118            },
119            "end": {
120              "line": 18,
121              "column": 2
122            }
123          }
124        },
125        "loc": {
126          "start": {
127            "line": 17,
128            "column": 1
129          },
130          "end": {
131            "line": 18,
132            "column": 2
133          }
134        }
135      },
136      "loc": {
137        "start": {
138          "line": 17,
139          "column": 1
140        },
141        "end": {
142          "line": 18,
143          "column": 2
144        }
145      }
146    },
147    {
148      "type": "ExpressionStatement",
149      "expression": {
150        "type": "CallExpression",
151        "callee": {
152          "type": "Identifier",
153          "name": "func",
154          "decorators": [],
155          "loc": {
156            "start": {
157              "line": 20,
158              "column": 1
159            },
160            "end": {
161              "line": 20,
162              "column": 5
163            }
164          }
165        },
166        "arguments": [
167          {
168            "type": "StringLiteral",
169            "value": "bar",
170            "loc": {
171              "start": {
172                "line": 20,
173                "column": 6
174              },
175              "end": {
176                "line": 20,
177                "column": 11
178              }
179            }
180          }
181        ],
182        "optional": false,
183        "loc": {
184          "start": {
185            "line": 20,
186            "column": 1
187          },
188          "end": {
189            "line": 20,
190            "column": 12
191          }
192        }
193      },
194      "loc": {
195        "start": {
196          "line": 20,
197          "column": 1
198        },
199        "end": {
200          "line": 20,
201          "column": 12
202        }
203      }
204    }
205  ],
206  "loc": {
207    "start": {
208      "line": 1,
209      "column": 1
210    },
211    "end": {
212      "line": 20,
213      "column": 12
214    }
215  }
216}
217TypeError: Type 'string' is not assignable to type 'number'. [functionCall_8.ts:20:6]
218