1{ 2 "type": "Program", 3 "statements": [ 4 { 5 "type": "ClassDeclaration", 6 "definition": { 7 "id": { 8 "type": "Identifier", 9 "name": "A", 10 "decorators": [], 11 "loc": { 12 "start": { 13 "line": 16, 14 "column": 7 15 }, 16 "end": { 17 "line": 16, 18 "column": 8 19 } 20 } 21 }, 22 "superClass": null, 23 "implements": [], 24 "body": [ 25 { 26 "type": "MethodDefinition", 27 "key": { 28 "type": "Identifier", 29 "name": "fun", 30 "decorators": [], 31 "loc": { 32 "start": { 33 "line": 17, 34 "column": 19 35 }, 36 "end": { 37 "line": 17, 38 "column": 22 39 } 40 } 41 }, 42 "kind": "method", 43 "accessibility": "public", 44 "static": true, 45 "optional": false, 46 "computed": false, 47 "value": { 48 "type": "FunctionExpression", 49 "function": { 50 "type": "ScriptFunction", 51 "id": { 52 "type": "Identifier", 53 "name": "fun", 54 "decorators": [], 55 "loc": { 56 "start": { 57 "line": 17, 58 "column": 19 59 }, 60 "end": { 61 "line": 17, 62 "column": 22 63 } 64 } 65 }, 66 "generator": false, 67 "async": false, 68 "expression": false, 69 "params": [], 70 "returnType": { 71 "type": "TSArrayType", 72 "elementType": { 73 "type": "ETSPrimitiveType", 74 "loc": { 75 "start": { 76 "line": 17, 77 "column": 26 78 }, 79 "end": { 80 "line": 17, 81 "column": 29 82 } 83 } 84 }, 85 "loc": { 86 "start": { 87 "line": 17, 88 "column": 32 89 }, 90 "end": { 91 "line": 17, 92 "column": 33 93 } 94 } 95 }, 96 "body": { 97 "type": "BlockStatement", 98 "statements": [ 99 { 100 "type": "ReturnStatement", 101 "argument": { 102 "type": "ETSNewArrayInstanceExpression", 103 "typeReference": { 104 "type": "ETSPrimitiveType", 105 "loc": { 106 "start": { 107 "line": 18, 108 "column": 20 109 }, 110 "end": { 111 "line": 18, 112 "column": 23 113 } 114 } 115 }, 116 "dimension": { 117 "type": "NumberLiteral", 118 "value": 10, 119 "loc": { 120 "start": { 121 "line": 18, 122 "column": 24 123 }, 124 "end": { 125 "line": 18, 126 "column": 26 127 } 128 } 129 }, 130 "loc": { 131 "start": { 132 "line": 18, 133 "column": 16 134 }, 135 "end": { 136 "line": 18, 137 "column": 27 138 } 139 } 140 }, 141 "loc": { 142 "start": { 143 "line": 18, 144 "column": 9 145 }, 146 "end": { 147 "line": 18, 148 "column": 28 149 } 150 } 151 } 152 ], 153 "loc": { 154 "start": { 155 "line": 17, 156 "column": 32 157 }, 158 "end": { 159 "line": 19, 160 "column": 6 161 } 162 } 163 }, 164 "loc": { 165 "start": { 166 "line": 17, 167 "column": 22 168 }, 169 "end": { 170 "line": 19, 171 "column": 6 172 } 173 } 174 }, 175 "loc": { 176 "start": { 177 "line": 17, 178 "column": 22 179 }, 180 "end": { 181 "line": 19, 182 "column": 6 183 } 184 } 185 }, 186 "overloads": [], 187 "decorators": [], 188 "loc": { 189 "start": { 190 "line": 17, 191 "column": 5 192 }, 193 "end": { 194 "line": 19, 195 "column": 6 196 } 197 } 198 }, 199 { 200 "type": "MethodDefinition", 201 "key": { 202 "type": "Identifier", 203 "name": "constructor", 204 "decorators": [], 205 "loc": { 206 "start": { 207 "line": 1, 208 "column": 1 209 }, 210 "end": { 211 "line": 1, 212 "column": 1 213 } 214 } 215 }, 216 "kind": "constructor", 217 "static": false, 218 "optional": false, 219 "computed": false, 220 "value": { 221 "type": "FunctionExpression", 222 "function": { 223 "type": "ScriptFunction", 224 "id": { 225 "type": "Identifier", 226 "name": "constructor", 227 "decorators": [], 228 "loc": { 229 "start": { 230 "line": 1, 231 "column": 1 232 }, 233 "end": { 234 "line": 1, 235 "column": 1 236 } 237 } 238 }, 239 "generator": false, 240 "async": false, 241 "expression": false, 242 "params": [], 243 "body": { 244 "type": "BlockStatement", 245 "statements": [], 246 "loc": { 247 "start": { 248 "line": 1, 249 "column": 1 250 }, 251 "end": { 252 "line": 1, 253 "column": 1 254 } 255 } 256 }, 257 "loc": { 258 "start": { 259 "line": 1, 260 "column": 1 261 }, 262 "end": { 263 "line": 1, 264 "column": 1 265 } 266 } 267 }, 268 "loc": { 269 "start": { 270 "line": 1, 271 "column": 1 272 }, 273 "end": { 274 "line": 1, 275 "column": 1 276 } 277 } 278 }, 279 "overloads": [], 280 "decorators": [], 281 "loc": { 282 "start": { 283 "line": 20, 284 "column": 2 285 }, 286 "end": { 287 "line": 20, 288 "column": 2 289 } 290 } 291 } 292 ], 293 "loc": { 294 "start": { 295 "line": 16, 296 "column": 9 297 }, 298 "end": { 299 "line": 20, 300 "column": 2 301 } 302 } 303 }, 304 "loc": { 305 "start": { 306 "line": 16, 307 "column": 1 308 }, 309 "end": { 310 "line": 20, 311 "column": 2 312 } 313 } 314 }, 315 { 316 "type": "ClassDeclaration", 317 "definition": { 318 "id": { 319 "type": "Identifier", 320 "name": "ETSGLOBAL", 321 "decorators": [], 322 "loc": { 323 "start": { 324 "line": 1, 325 "column": 1 326 }, 327 "end": { 328 "line": 1, 329 "column": 1 330 } 331 } 332 }, 333 "superClass": null, 334 "implements": [], 335 "body": [ 336 { 337 "type": "MethodDefinition", 338 "key": { 339 "type": "Identifier", 340 "name": "_$init$_", 341 "decorators": [], 342 "loc": { 343 "start": { 344 "line": 1, 345 "column": 1 346 }, 347 "end": { 348 "line": 1, 349 "column": 1 350 } 351 } 352 }, 353 "kind": "method", 354 "accessibility": "public", 355 "static": true, 356 "optional": false, 357 "computed": false, 358 "value": { 359 "type": "FunctionExpression", 360 "function": { 361 "type": "ScriptFunction", 362 "id": { 363 "type": "Identifier", 364 "name": "_$init$_", 365 "decorators": [], 366 "loc": { 367 "start": { 368 "line": 1, 369 "column": 1 370 }, 371 "end": { 372 "line": 1, 373 "column": 1 374 } 375 } 376 }, 377 "generator": false, 378 "async": false, 379 "expression": false, 380 "params": [], 381 "body": { 382 "type": "BlockStatement", 383 "statements": [], 384 "loc": { 385 "start": { 386 "line": 1, 387 "column": 1 388 }, 389 "end": { 390 "line": 1, 391 "column": 1 392 } 393 } 394 }, 395 "loc": { 396 "start": { 397 "line": 1, 398 "column": 1 399 }, 400 "end": { 401 "line": 1, 402 "column": 1 403 } 404 } 405 }, 406 "loc": { 407 "start": { 408 "line": 1, 409 "column": 1 410 }, 411 "end": { 412 "line": 1, 413 "column": 1 414 } 415 } 416 }, 417 "overloads": [], 418 "decorators": [], 419 "loc": { 420 "start": { 421 "line": 1, 422 "column": 1 423 }, 424 "end": { 425 "line": 1, 426 "column": 1 427 } 428 } 429 }, 430 { 431 "type": "MethodDefinition", 432 "key": { 433 "type": "Identifier", 434 "name": "main", 435 "decorators": [], 436 "loc": { 437 "start": { 438 "line": 22, 439 "column": 10 440 }, 441 "end": { 442 "line": 22, 443 "column": 14 444 } 445 } 446 }, 447 "kind": "method", 448 "accessibility": "public", 449 "static": true, 450 "optional": false, 451 "computed": false, 452 "value": { 453 "type": "FunctionExpression", 454 "function": { 455 "type": "ScriptFunction", 456 "id": { 457 "type": "Identifier", 458 "name": "main", 459 "decorators": [], 460 "loc": { 461 "start": { 462 "line": 22, 463 "column": 10 464 }, 465 "end": { 466 "line": 22, 467 "column": 14 468 } 469 } 470 }, 471 "generator": false, 472 "async": false, 473 "expression": false, 474 "params": [], 475 "returnType": { 476 "type": "ETSPrimitiveType", 477 "loc": { 478 "start": { 479 "line": 22, 480 "column": 18 481 }, 482 "end": { 483 "line": 22, 484 "column": 21 485 } 486 } 487 }, 488 "body": { 489 "type": "BlockStatement", 490 "statements": [ 491 { 492 "type": "VariableDeclaration", 493 "declarations": [ 494 { 495 "type": "VariableDeclarator", 496 "id": { 497 "type": "Identifier", 498 "name": "obj", 499 "decorators": [], 500 "loc": { 501 "start": { 502 "line": 23, 503 "column": 9 504 }, 505 "end": { 506 "line": 23, 507 "column": 12 508 } 509 } 510 }, 511 "init": { 512 "type": "ETSNewClassInstanceExpression", 513 "typeReference": { 514 "type": "ETSTypeReference", 515 "part": { 516 "type": "ETSTypeReferencePart", 517 "name": { 518 "type": "TSQualifiedName", 519 "left": { 520 "type": "Identifier", 521 "name": "A", 522 "decorators": [], 523 "loc": { 524 "start": { 525 "line": 23, 526 "column": 19 527 }, 528 "end": { 529 "line": 23, 530 "column": 20 531 } 532 } 533 }, 534 "right": { 535 "type": "Identifier", 536 "name": "fun", 537 "decorators": [], 538 "loc": { 539 "start": { 540 "line": 23, 541 "column": 21 542 }, 543 "end": { 544 "line": 23, 545 "column": 24 546 } 547 } 548 }, 549 "loc": { 550 "start": { 551 "line": 23, 552 "column": 19 553 }, 554 "end": { 555 "line": 23, 556 "column": 25 557 } 558 } 559 }, 560 "loc": { 561 "start": { 562 "line": 23, 563 "column": 19 564 }, 565 "end": { 566 "line": 23, 567 "column": 25 568 } 569 } 570 }, 571 "loc": { 572 "start": { 573 "line": 23, 574 "column": 19 575 }, 576 "end": { 577 "line": 23, 578 "column": 25 579 } 580 } 581 }, 582 "arguments": [], 583 "loc": { 584 "start": { 585 "line": 23, 586 "column": 15 587 }, 588 "end": { 589 "line": 23, 590 "column": 27 591 } 592 } 593 }, 594 "loc": { 595 "start": { 596 "line": 23, 597 "column": 9 598 }, 599 "end": { 600 "line": 23, 601 "column": 27 602 } 603 } 604 } 605 ], 606 "kind": "let", 607 "loc": { 608 "start": { 609 "line": 23, 610 "column": 5 611 }, 612 "end": { 613 "line": 23, 614 "column": 27 615 } 616 } 617 }, 618 { 619 "type": "ReturnStatement", 620 "argument": { 621 "type": "NumberLiteral", 622 "value": 0, 623 "loc": { 624 "start": { 625 "line": 24, 626 "column": 12 627 }, 628 "end": { 629 "line": 24, 630 "column": 13 631 } 632 } 633 }, 634 "loc": { 635 "start": { 636 "line": 24, 637 "column": 5 638 }, 639 "end": { 640 "line": 24, 641 "column": 14 642 } 643 } 644 } 645 ], 646 "loc": { 647 "start": { 648 "line": 22, 649 "column": 22 650 }, 651 "end": { 652 "line": 25, 653 "column": 2 654 } 655 } 656 }, 657 "loc": { 658 "start": { 659 "line": 22, 660 "column": 14 661 }, 662 "end": { 663 "line": 25, 664 "column": 2 665 } 666 } 667 }, 668 "loc": { 669 "start": { 670 "line": 22, 671 "column": 14 672 }, 673 "end": { 674 "line": 25, 675 "column": 2 676 } 677 } 678 }, 679 "overloads": [], 680 "decorators": [], 681 "loc": { 682 "start": { 683 "line": 22, 684 "column": 1 685 }, 686 "end": { 687 "line": 25, 688 "column": 2 689 } 690 } 691 } 692 ], 693 "loc": { 694 "start": { 695 "line": 1, 696 "column": 1 697 }, 698 "end": { 699 "line": 1, 700 "column": 1 701 } 702 } 703 }, 704 "loc": { 705 "start": { 706 "line": 1, 707 "column": 1 708 }, 709 "end": { 710 "line": 1, 711 "column": 1 712 } 713 } 714 } 715 ], 716 "loc": { 717 "start": { 718 "line": 1, 719 "column": 1 720 }, 721 "end": { 722 "line": 26, 723 "column": 1 724 } 725 } 726} 727TypeError: 'fun' type does not exist. [newClassInstanceExpression.ets:23:21] 728