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