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": "foo",
30              "decorators": [],
31              "loc": {
32                "start": {
33                  "line": 17,
34                  "column": 5
35                },
36                "end": {
37                  "line": 17,
38                  "column": 8
39                }
40              }
41            },
42            "kind": "method",
43            "accessibility": "public",
44            "static": false,
45            "optional": false,
46            "computed": false,
47            "value": {
48              "type": "FunctionExpression",
49              "function": {
50                "type": "ScriptFunction",
51                "id": {
52                  "type": "Identifier",
53                  "name": "foo",
54                  "decorators": [],
55                  "loc": {
56                    "start": {
57                      "line": 17,
58                      "column": 5
59                    },
60                    "end": {
61                      "line": 17,
62                      "column": 8
63                    }
64                  }
65                },
66                "generator": false,
67                "async": false,
68                "expression": false,
69                "params": [],
70                "returnType": {
71                  "type": "ETSUnionType",
72                  "types": [
73                    {
74                      "type": "ETSTypeReference",
75                      "part": {
76                        "type": "ETSTypeReferencePart",
77                        "name": {
78                          "type": "Identifier",
79                          "name": "A",
80                          "decorators": [],
81                          "loc": {
82                            "start": {
83                              "line": 17,
84                              "column": 13
85                            },
86                            "end": {
87                              "line": 17,
88                              "column": 14
89                            }
90                          }
91                        },
92                        "loc": {
93                          "start": {
94                            "line": 17,
95                            "column": 13
96                          },
97                          "end": {
98                            "line": 17,
99                            "column": 16
100                          }
101                        }
102                      },
103                      "loc": {
104                        "start": {
105                          "line": 17,
106                          "column": 13
107                        },
108                        "end": {
109                          "line": 17,
110                          "column": 16
111                        }
112                      }
113                    },
114                    {
115                      "type": "ETSNullType",
116                      "loc": {
117                        "start": {
118                          "line": 17,
119                          "column": 17
120                        },
121                        "end": {
122                          "line": 17,
123                          "column": 21
124                        }
125                      }
126                    }
127                  ],
128                  "loc": {
129                    "start": {
130                      "line": 17,
131                      "column": 13
132                    },
133                    "end": {
134                      "line": 17,
135                      "column": 21
136                    }
137                  }
138                },
139                "body": {
140                  "type": "BlockStatement",
141                  "statements": [
142                    {
143                      "type": "ReturnStatement",
144                      "argument": {
145                        "type": "ETSNewClassInstanceExpression",
146                        "typeReference": {
147                          "type": "ETSTypeReference",
148                          "part": {
149                            "type": "ETSTypeReferencePart",
150                            "name": {
151                              "type": "Identifier",
152                              "name": "A",
153                              "decorators": [],
154                              "loc": {
155                                "start": {
156                                  "line": 18,
157                                  "column": 20
158                                },
159                                "end": {
160                                  "line": 18,
161                                  "column": 21
162                                }
163                              }
164                            },
165                            "loc": {
166                              "start": {
167                                "line": 18,
168                                "column": 20
169                              },
170                              "end": {
171                                "line": 18,
172                                "column": 22
173                              }
174                            }
175                          },
176                          "loc": {
177                            "start": {
178                              "line": 18,
179                              "column": 20
180                            },
181                            "end": {
182                              "line": 18,
183                              "column": 22
184                            }
185                          }
186                        },
187                        "arguments": [],
188                        "loc": {
189                          "start": {
190                            "line": 18,
191                            "column": 16
192                          },
193                          "end": {
194                            "line": 18,
195                            "column": 24
196                          }
197                        }
198                      },
199                      "loc": {
200                        "start": {
201                          "line": 18,
202                          "column": 9
203                        },
204                        "end": {
205                          "line": 18,
206                          "column": 24
207                        }
208                      }
209                    }
210                  ],
211                  "loc": {
212                    "start": {
213                      "line": 17,
214                      "column": 22
215                    },
216                    "end": {
217                      "line": 19,
218                      "column": 6
219                    }
220                  }
221                },
222                "loc": {
223                  "start": {
224                    "line": 17,
225                    "column": 8
226                  },
227                  "end": {
228                    "line": 19,
229                    "column": 6
230                  }
231                }
232              },
233              "loc": {
234                "start": {
235                  "line": 17,
236                  "column": 8
237                },
238                "end": {
239                  "line": 19,
240                  "column": 6
241                }
242              }
243            },
244            "overloads": [],
245            "decorators": [],
246            "loc": {
247              "start": {
248                "line": 17,
249                "column": 5
250              },
251              "end": {
252                "line": 19,
253                "column": 6
254              }
255            }
256          },
257          {
258            "type": "MethodDefinition",
259            "key": {
260              "type": "Identifier",
261              "name": "constructor",
262              "decorators": [],
263              "loc": {
264                "start": {
265                  "line": 1,
266                  "column": 1
267                },
268                "end": {
269                  "line": 1,
270                  "column": 1
271                }
272              }
273            },
274            "kind": "constructor",
275            "static": false,
276            "optional": false,
277            "computed": false,
278            "value": {
279              "type": "FunctionExpression",
280              "function": {
281                "type": "ScriptFunction",
282                "id": {
283                  "type": "Identifier",
284                  "name": "constructor",
285                  "decorators": [],
286                  "loc": {
287                    "start": {
288                      "line": 1,
289                      "column": 1
290                    },
291                    "end": {
292                      "line": 1,
293                      "column": 1
294                    }
295                  }
296                },
297                "generator": false,
298                "async": false,
299                "expression": false,
300                "params": [],
301                "body": {
302                  "type": "BlockStatement",
303                  "statements": [],
304                  "loc": {
305                    "start": {
306                      "line": 1,
307                      "column": 1
308                    },
309                    "end": {
310                      "line": 1,
311                      "column": 1
312                    }
313                  }
314                },
315                "loc": {
316                  "start": {
317                    "line": 1,
318                    "column": 1
319                  },
320                  "end": {
321                    "line": 1,
322                    "column": 1
323                  }
324                }
325              },
326              "loc": {
327                "start": {
328                  "line": 1,
329                  "column": 1
330                },
331                "end": {
332                  "line": 1,
333                  "column": 1
334                }
335              }
336            },
337            "overloads": [],
338            "decorators": [],
339            "loc": {
340              "start": {
341                "line": 20,
342                "column": 2
343              },
344              "end": {
345                "line": 20,
346                "column": 2
347              }
348            }
349          }
350        ],
351        "loc": {
352          "start": {
353            "line": 16,
354            "column": 9
355          },
356          "end": {
357            "line": 20,
358            "column": 2
359          }
360        }
361      },
362      "loc": {
363        "start": {
364          "line": 16,
365          "column": 1
366        },
367        "end": {
368          "line": 20,
369          "column": 2
370        }
371      }
372    },
373    {
374      "type": "ClassDeclaration",
375      "definition": {
376        "id": {
377          "type": "Identifier",
378          "name": "ETSGLOBAL",
379          "decorators": [],
380          "loc": {
381            "start": {
382              "line": 1,
383              "column": 1
384            },
385            "end": {
386              "line": 1,
387              "column": 1
388            }
389          }
390        },
391        "superClass": null,
392        "implements": [],
393        "body": [
394          {
395            "type": "MethodDefinition",
396            "key": {
397              "type": "Identifier",
398              "name": "_$init$_",
399              "decorators": [],
400              "loc": {
401                "start": {
402                  "line": 1,
403                  "column": 1
404                },
405                "end": {
406                  "line": 1,
407                  "column": 1
408                }
409              }
410            },
411            "kind": "method",
412            "accessibility": "public",
413            "static": true,
414            "optional": false,
415            "computed": false,
416            "value": {
417              "type": "FunctionExpression",
418              "function": {
419                "type": "ScriptFunction",
420                "id": {
421                  "type": "Identifier",
422                  "name": "_$init$_",
423                  "decorators": [],
424                  "loc": {
425                    "start": {
426                      "line": 1,
427                      "column": 1
428                    },
429                    "end": {
430                      "line": 1,
431                      "column": 1
432                    }
433                  }
434                },
435                "generator": false,
436                "async": false,
437                "expression": false,
438                "params": [],
439                "body": {
440                  "type": "BlockStatement",
441                  "statements": [],
442                  "loc": {
443                    "start": {
444                      "line": 1,
445                      "column": 1
446                    },
447                    "end": {
448                      "line": 1,
449                      "column": 1
450                    }
451                  }
452                },
453                "loc": {
454                  "start": {
455                    "line": 1,
456                    "column": 1
457                  },
458                  "end": {
459                    "line": 1,
460                    "column": 1
461                  }
462                }
463              },
464              "loc": {
465                "start": {
466                  "line": 1,
467                  "column": 1
468                },
469                "end": {
470                  "line": 1,
471                  "column": 1
472                }
473              }
474            },
475            "overloads": [],
476            "decorators": [],
477            "loc": {
478              "start": {
479                "line": 1,
480                "column": 1
481              },
482              "end": {
483                "line": 1,
484                "column": 1
485              }
486            }
487          },
488          {
489            "type": "MethodDefinition",
490            "key": {
491              "type": "Identifier",
492              "name": "main",
493              "decorators": [],
494              "loc": {
495                "start": {
496                  "line": 22,
497                  "column": 10
498                },
499                "end": {
500                  "line": 22,
501                  "column": 14
502                }
503              }
504            },
505            "kind": "method",
506            "accessibility": "public",
507            "static": true,
508            "optional": false,
509            "computed": false,
510            "value": {
511              "type": "FunctionExpression",
512              "function": {
513                "type": "ScriptFunction",
514                "id": {
515                  "type": "Identifier",
516                  "name": "main",
517                  "decorators": [],
518                  "loc": {
519                    "start": {
520                      "line": 22,
521                      "column": 10
522                    },
523                    "end": {
524                      "line": 22,
525                      "column": 14
526                    }
527                  }
528                },
529                "generator": false,
530                "async": false,
531                "expression": false,
532                "params": [],
533                "returnType": {
534                  "type": "ETSPrimitiveType",
535                  "loc": {
536                    "start": {
537                      "line": 22,
538                      "column": 18
539                    },
540                    "end": {
541                      "line": 22,
542                      "column": 22
543                    }
544                  }
545                },
546                "body": {
547                  "type": "BlockStatement",
548                  "statements": [
549                    {
550                      "type": "VariableDeclaration",
551                      "declarations": [
552                        {
553                          "type": "VariableDeclarator",
554                          "id": {
555                            "type": "Identifier",
556                            "name": "an",
557                            "typeAnnotation": {
558                              "type": "ETSUnionType",
559                              "types": [
560                                {
561                                  "type": "ETSTypeReference",
562                                  "part": {
563                                    "type": "ETSTypeReferencePart",
564                                    "name": {
565                                      "type": "Identifier",
566                                      "name": "A",
567                                      "decorators": [],
568                                      "loc": {
569                                        "start": {
570                                          "line": 23,
571                                          "column": 14
572                                        },
573                                        "end": {
574                                          "line": 23,
575                                          "column": 15
576                                        }
577                                      }
578                                    },
579                                    "loc": {
580                                      "start": {
581                                        "line": 23,
582                                        "column": 14
583                                      },
584                                      "end": {
585                                        "line": 23,
586                                        "column": 17
587                                      }
588                                    }
589                                  },
590                                  "loc": {
591                                    "start": {
592                                      "line": 23,
593                                      "column": 14
594                                    },
595                                    "end": {
596                                      "line": 23,
597                                      "column": 17
598                                    }
599                                  }
600                                },
601                                {
602                                  "type": "ETSNullType",
603                                  "loc": {
604                                    "start": {
605                                      "line": 23,
606                                      "column": 18
607                                    },
608                                    "end": {
609                                      "line": 23,
610                                      "column": 22
611                                    }
612                                  }
613                                }
614                              ],
615                              "loc": {
616                                "start": {
617                                  "line": 23,
618                                  "column": 14
619                                },
620                                "end": {
621                                  "line": 23,
622                                  "column": 22
623                                }
624                              }
625                            },
626                            "decorators": [],
627                            "loc": {
628                              "start": {
629                                "line": 23,
630                                "column": 9
631                              },
632                              "end": {
633                                "line": 23,
634                                "column": 11
635                              }
636                            }
637                          },
638                          "init": {
639                            "type": "ETSNewClassInstanceExpression",
640                            "typeReference": {
641                              "type": "ETSTypeReference",
642                              "part": {
643                                "type": "ETSTypeReferencePart",
644                                "name": {
645                                  "type": "Identifier",
646                                  "name": "A",
647                                  "decorators": [],
648                                  "loc": {
649                                    "start": {
650                                      "line": 23,
651                                      "column": 29
652                                    },
653                                    "end": {
654                                      "line": 23,
655                                      "column": 30
656                                    }
657                                  }
658                                },
659                                "loc": {
660                                  "start": {
661                                    "line": 23,
662                                    "column": 29
663                                  },
664                                  "end": {
665                                    "line": 23,
666                                    "column": 31
667                                  }
668                                }
669                              },
670                              "loc": {
671                                "start": {
672                                  "line": 23,
673                                  "column": 29
674                                },
675                                "end": {
676                                  "line": 23,
677                                  "column": 31
678                                }
679                              }
680                            },
681                            "arguments": [],
682                            "loc": {
683                              "start": {
684                                "line": 23,
685                                "column": 25
686                              },
687                              "end": {
688                                "line": 23,
689                                "column": 33
690                              }
691                            }
692                          },
693                          "loc": {
694                            "start": {
695                              "line": 23,
696                              "column": 9
697                            },
698                            "end": {
699                              "line": 23,
700                              "column": 33
701                            }
702                          }
703                        }
704                      ],
705                      "kind": "let",
706                      "loc": {
707                        "start": {
708                          "line": 23,
709                          "column": 5
710                        },
711                        "end": {
712                          "line": 23,
713                          "column": 33
714                        }
715                      }
716                    },
717                    {
718                      "type": "VariableDeclaration",
719                      "declarations": [
720                        {
721                          "type": "VariableDeclarator",
722                          "id": {
723                            "type": "Identifier",
724                            "name": "x",
725                            "typeAnnotation": {
726                              "type": "ETSTypeReference",
727                              "part": {
728                                "type": "ETSTypeReferencePart",
729                                "name": {
730                                  "type": "Identifier",
731                                  "name": "Object",
732                                  "decorators": [],
733                                  "loc": {
734                                    "start": {
735                                      "line": 24,
736                                      "column": 13
737                                    },
738                                    "end": {
739                                      "line": 24,
740                                      "column": 19
741                                    }
742                                  }
743                                },
744                                "loc": {
745                                  "start": {
746                                    "line": 24,
747                                    "column": 13
748                                  },
749                                  "end": {
750                                    "line": 24,
751                                    "column": 21
752                                  }
753                                }
754                              },
755                              "loc": {
756                                "start": {
757                                  "line": 24,
758                                  "column": 13
759                                },
760                                "end": {
761                                  "line": 24,
762                                  "column": 21
763                                }
764                              }
765                            },
766                            "decorators": [],
767                            "loc": {
768                              "start": {
769                                "line": 24,
770                                "column": 9
771                              },
772                              "end": {
773                                "line": 24,
774                                "column": 10
775                              }
776                            }
777                          },
778                          "init": {
779                            "type": "TSNonNullExpression",
780                            "expression": {
781                              "type": "CallExpression",
782                              "callee": {
783                                "type": "MemberExpression",
784                                "object": {
785                                  "type": "Identifier",
786                                  "name": "an",
787                                  "decorators": [],
788                                  "loc": {
789                                    "start": {
790                                      "line": 24,
791                                      "column": 22
792                                    },
793                                    "end": {
794                                      "line": 24,
795                                      "column": 24
796                                    }
797                                  }
798                                },
799                                "property": {
800                                  "type": "Identifier",
801                                  "name": "foo",
802                                  "decorators": [],
803                                  "loc": {
804                                    "start": {
805                                      "line": 24,
806                                      "column": 25
807                                    },
808                                    "end": {
809                                      "line": 24,
810                                      "column": 28
811                                    }
812                                  }
813                                },
814                                "computed": false,
815                                "optional": false,
816                                "loc": {
817                                  "start": {
818                                    "line": 24,
819                                    "column": 22
820                                  },
821                                  "end": {
822                                    "line": 24,
823                                    "column": 28
824                                  }
825                                }
826                              },
827                              "arguments": [],
828                              "optional": false,
829                              "loc": {
830                                "start": {
831                                  "line": 24,
832                                  "column": 22
833                                },
834                                "end": {
835                                  "line": 24,
836                                  "column": 30
837                                }
838                              }
839                            },
840                            "loc": {
841                              "start": {
842                                "line": 24,
843                                "column": 22
844                              },
845                              "end": {
846                                "line": 24,
847                                "column": 31
848                              }
849                            }
850                          },
851                          "loc": {
852                            "start": {
853                              "line": 24,
854                              "column": 9
855                            },
856                            "end": {
857                              "line": 24,
858                              "column": 31
859                            }
860                          }
861                        }
862                      ],
863                      "kind": "let",
864                      "loc": {
865                        "start": {
866                          "line": 24,
867                          "column": 5
868                        },
869                        "end": {
870                          "line": 24,
871                          "column": 32
872                        }
873                      }
874                    }
875                  ],
876                  "loc": {
877                    "start": {
878                      "line": 22,
879                      "column": 23
880                    },
881                    "end": {
882                      "line": 25,
883                      "column": 2
884                    }
885                  }
886                },
887                "loc": {
888                  "start": {
889                    "line": 22,
890                    "column": 14
891                  },
892                  "end": {
893                    "line": 25,
894                    "column": 2
895                  }
896                }
897              },
898              "loc": {
899                "start": {
900                  "line": 22,
901                  "column": 14
902                },
903                "end": {
904                  "line": 25,
905                  "column": 2
906                }
907              }
908            },
909            "overloads": [],
910            "decorators": [],
911            "loc": {
912              "start": {
913                "line": 22,
914                "column": 1
915              },
916              "end": {
917                "line": 25,
918                "column": 2
919              }
920            }
921          }
922        ],
923        "loc": {
924          "start": {
925            "line": 1,
926            "column": 1
927          },
928          "end": {
929            "line": 1,
930            "column": 1
931          }
932        }
933      },
934      "loc": {
935        "start": {
936          "line": 1,
937          "column": 1
938        },
939        "end": {
940          "line": 1,
941          "column": 1
942        }
943      }
944    }
945  ],
946  "loc": {
947    "start": {
948      "line": 1,
949      "column": 1
950    },
951    "end": {
952      "line": 26,
953      "column": 1
954    }
955  }
956}
957