1{ 2 "type": "Program", 3 "statements": [ 4 { 5 "type": "FunctionDeclaration", 6 "function": { 7 "type": "ScriptFunction", 8 "id": { 9 "type": "Identifier", 10 "name": "foo", 11 "decorators": [], 12 "loc": { 13 "start": { 14 "line": 17, 15 "column": 10 16 }, 17 "end": { 18 "line": 17, 19 "column": 13 20 } 21 } 22 }, 23 "generator": false, 24 "async": false, 25 "expression": false, 26 "params": [ 27 { 28 "type": "AssignmentPattern", 29 "left": { 30 "type": "ObjectPattern", 31 "properties": [ 32 { 33 "type": "Property", 34 "method": false, 35 "shorthand": true, 36 "computed": false, 37 "key": { 38 "type": "Identifier", 39 "name": "x", 40 "decorators": [], 41 "loc": { 42 "start": { 43 "line": 17, 44 "column": 16 45 }, 46 "end": { 47 "line": 17, 48 "column": 17 49 } 50 } 51 }, 52 "value": { 53 "type": "AssignmentPattern", 54 "left": { 55 "type": "Identifier", 56 "name": "x", 57 "decorators": [], 58 "loc": { 59 "start": { 60 "line": 17, 61 "column": 16 62 }, 63 "end": { 64 "line": 17, 65 "column": 17 66 } 67 } 68 }, 69 "right": { 70 "type": "NumberLiteral", 71 "value": 6, 72 "loc": { 73 "start": { 74 "line": 17, 75 "column": 20 76 }, 77 "end": { 78 "line": 17, 79 "column": 21 80 } 81 } 82 }, 83 "loc": { 84 "start": { 85 "line": 17, 86 "column": 16 87 }, 88 "end": { 89 "line": 17, 90 "column": 21 91 } 92 } 93 }, 94 "kind": "init", 95 "loc": { 96 "start": { 97 "line": 17, 98 "column": 16 99 }, 100 "end": { 101 "line": 17, 102 "column": 21 103 } 104 } 105 }, 106 { 107 "type": "Property", 108 "method": false, 109 "shorthand": true, 110 "computed": false, 111 "key": { 112 "type": "Identifier", 113 "name": "y", 114 "decorators": [], 115 "loc": { 116 "start": { 117 "line": 17, 118 "column": 23 119 }, 120 "end": { 121 "line": 17, 122 "column": 24 123 } 124 } 125 }, 126 "value": { 127 "type": "AssignmentPattern", 128 "left": { 129 "type": "Identifier", 130 "name": "y", 131 "decorators": [], 132 "loc": { 133 "start": { 134 "line": 17, 135 "column": 23 136 }, 137 "end": { 138 "line": 17, 139 "column": 24 140 } 141 } 142 }, 143 "right": { 144 "type": "StringLiteral", 145 "value": "foo", 146 "loc": { 147 "start": { 148 "line": 17, 149 "column": 27 150 }, 151 "end": { 152 "line": 17, 153 "column": 32 154 } 155 } 156 }, 157 "loc": { 158 "start": { 159 "line": 17, 160 "column": 23 161 }, 162 "end": { 163 "line": 17, 164 "column": 32 165 } 166 } 167 }, 168 "kind": "init", 169 "loc": { 170 "start": { 171 "line": 17, 172 "column": 23 173 }, 174 "end": { 175 "line": 17, 176 "column": 32 177 } 178 } 179 } 180 ], 181 "loc": { 182 "start": { 183 "line": 17, 184 "column": 14 185 }, 186 "end": { 187 "line": 17, 188 "column": 34 189 } 190 } 191 }, 192 "right": { 193 "type": "ObjectExpression", 194 "properties": [ 195 { 196 "type": "Property", 197 "method": false, 198 "shorthand": false, 199 "computed": false, 200 "key": { 201 "type": "Identifier", 202 "name": "x", 203 "decorators": [], 204 "loc": { 205 "start": { 206 "line": 17, 207 "column": 39 208 }, 209 "end": { 210 "line": 17, 211 "column": 40 212 } 213 } 214 }, 215 "value": { 216 "type": "StringLiteral", 217 "value": "foo", 218 "loc": { 219 "start": { 220 "line": 17, 221 "column": 42 222 }, 223 "end": { 224 "line": 17, 225 "column": 47 226 } 227 } 228 }, 229 "kind": "init", 230 "loc": { 231 "start": { 232 "line": 17, 233 "column": 39 234 }, 235 "end": { 236 "line": 17, 237 "column": 47 238 } 239 } 240 } 241 ], 242 "loc": { 243 "start": { 244 "line": 17, 245 "column": 37 246 }, 247 "end": { 248 "line": 17, 249 "column": 49 250 } 251 } 252 }, 253 "loc": { 254 "start": { 255 "line": 17, 256 "column": 14 257 }, 258 "end": { 259 "line": 17, 260 "column": 49 261 } 262 } 263 } 264 ], 265 "body": { 266 "type": "BlockStatement", 267 "statements": [], 268 "loc": { 269 "start": { 270 "line": 17, 271 "column": 51 272 }, 273 "end": { 274 "line": 19, 275 "column": 2 276 } 277 } 278 }, 279 "loc": { 280 "start": { 281 "line": 17, 282 "column": 1 283 }, 284 "end": { 285 "line": 19, 286 "column": 2 287 } 288 } 289 }, 290 "loc": { 291 "start": { 292 "line": 17, 293 "column": 1 294 }, 295 "end": { 296 "line": 19, 297 "column": 2 298 } 299 } 300 }, 301 { 302 "type": "ExpressionStatement", 303 "expression": { 304 "type": "BinaryExpression", 305 "operator": "+", 306 "left": { 307 "type": "Identifier", 308 "name": "foo", 309 "decorators": [], 310 "loc": { 311 "start": { 312 "line": 21, 313 "column": 1 314 }, 315 "end": { 316 "line": 21, 317 "column": 4 318 } 319 } 320 }, 321 "right": { 322 "type": "NumberLiteral", 323 "value": 5, 324 "loc": { 325 "start": { 326 "line": 21, 327 "column": 7 328 }, 329 "end": { 330 "line": 21, 331 "column": 8 332 } 333 } 334 }, 335 "loc": { 336 "start": { 337 "line": 21, 338 "column": 1 339 }, 340 "end": { 341 "line": 21, 342 "column": 8 343 } 344 } 345 }, 346 "loc": { 347 "start": { 348 "line": 21, 349 "column": 1 350 }, 351 "end": { 352 "line": 21, 353 "column": 9 354 } 355 } 356 } 357 ], 358 "loc": { 359 "start": { 360 "line": 1, 361 "column": 1 362 }, 363 "end": { 364 "line": 21, 365 "column": 9 366 } 367 } 368} 369TypeError: operator + cannot be applied to types ({ x, y }?: { x?: string; y?: string; }) => void and number [functionWithPattern2.ts:21:1] 370