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