5007f895491a8fd45ef5bd8da0a079938bf4f7f7 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
  1. compilation_unit {
  2. package_statement {
  3. package_name: "ExplorerTest"
  4. }
  5. is_api: true
  6. declarations {
  7. class_declaration {
  8. name {
  9. name: "Class"
  10. }
  11. members {
  12. variable {
  13. binding {
  14. name: "a"
  15. type {
  16. expression_pattern {
  17. expression {
  18. int_type_literal {
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }
  28. declarations {
  29. class_declaration {
  30. name {
  31. name: "GenericClass"
  32. }
  33. members {
  34. variable {
  35. binding {
  36. name: "a"
  37. type {
  38. expression_pattern {
  39. expression {
  40. identifier {
  41. name: "T"
  42. }
  43. }
  44. }
  45. }
  46. }
  47. }
  48. }
  49. type_params {
  50. fields {
  51. generic_binding {
  52. name: "T"
  53. type {
  54. type_type_literal {
  55. }
  56. }
  57. }
  58. }
  59. }
  60. }
  61. }
  62. declarations {
  63. interface {
  64. name {
  65. name: "Interface"
  66. }
  67. members {
  68. function {
  69. name {
  70. name: "Make"
  71. }
  72. param_pattern {
  73. }
  74. return_term {
  75. kind: Expression
  76. type {
  77. identifier {
  78. name: "Self"
  79. }
  80. }
  81. }
  82. }
  83. }
  84. }
  85. }
  86. declarations {
  87. interface {
  88. name {
  89. name: "GenericInterface"
  90. }
  91. members {
  92. function {
  93. name {
  94. name: "Make"
  95. }
  96. param_pattern {
  97. }
  98. return_term {
  99. kind: Expression
  100. type {
  101. tuple_literal {
  102. fields {
  103. identifier {
  104. name: "Self"
  105. }
  106. }
  107. fields {
  108. identifier {
  109. name: "T"
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. declarations {
  120. alias {
  121. name {
  122. name: "ClassAlias"
  123. }
  124. target {
  125. identifier {
  126. name: "Class"
  127. }
  128. }
  129. }
  130. }
  131. declarations {
  132. alias {
  133. name {
  134. name: "GenericClassAlias"
  135. }
  136. target {
  137. identifier {
  138. name: "GenericClass"
  139. }
  140. }
  141. }
  142. }
  143. declarations {
  144. alias {
  145. name {
  146. name: "ClassSpecializationAlias"
  147. }
  148. target {
  149. call {
  150. function {
  151. identifier {
  152. name: "GenericClassAlias"
  153. }
  154. }
  155. argument {
  156. tuple_literal {
  157. fields {
  158. int_type_literal {
  159. }
  160. }
  161. }
  162. }
  163. }
  164. }
  165. }
  166. }
  167. declarations {
  168. alias {
  169. name {
  170. name: "InterfaceAlias"
  171. }
  172. target {
  173. identifier {
  174. name: "Interface"
  175. }
  176. }
  177. }
  178. }
  179. declarations {
  180. alias {
  181. name {
  182. name: "GenericInterfaceAlias"
  183. }
  184. target {
  185. identifier {
  186. name: "GenericInterface"
  187. }
  188. }
  189. }
  190. }
  191. declarations {
  192. alias {
  193. name {
  194. name: "InterfaceSpecializationAlias"
  195. }
  196. target {
  197. call {
  198. function {
  199. identifier {
  200. name: "GenericInterfaceAlias"
  201. }
  202. }
  203. argument {
  204. tuple_literal {
  205. fields {
  206. int_type_literal {
  207. }
  208. }
  209. }
  210. }
  211. }
  212. }
  213. }
  214. }
  215. declarations {
  216. impl {
  217. kind: InternalImpl
  218. impl_type {
  219. identifier {
  220. name: "ClassAlias"
  221. }
  222. }
  223. interface {
  224. identifier {
  225. name: "InterfaceAlias"
  226. }
  227. }
  228. members {
  229. function {
  230. name {
  231. name: "Make"
  232. }
  233. param_pattern {
  234. }
  235. return_term {
  236. kind: Expression
  237. type {
  238. identifier {
  239. name: "Self"
  240. }
  241. }
  242. }
  243. body {
  244. statements {
  245. return_expression_statement {
  246. expression {
  247. struct_literal {
  248. fields {
  249. name: "a"
  250. expression {
  251. int_literal {
  252. value: 1
  253. }
  254. }
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }
  261. }
  262. }
  263. }
  264. }
  265. declarations {
  266. impl {
  267. kind: InternalImpl
  268. impl_type {
  269. identifier {
  270. name: "ClassSpecializationAlias"
  271. }
  272. }
  273. interface {
  274. identifier {
  275. name: "InterfaceSpecializationAlias"
  276. }
  277. }
  278. members {
  279. function {
  280. name {
  281. name: "Make"
  282. }
  283. param_pattern {
  284. }
  285. return_term {
  286. kind: Expression
  287. type {
  288. tuple_literal {
  289. fields {
  290. identifier {
  291. name: "Self"
  292. }
  293. }
  294. fields {
  295. int_type_literal {
  296. }
  297. }
  298. }
  299. }
  300. }
  301. body {
  302. statements {
  303. return_expression_statement {
  304. expression {
  305. tuple_literal {
  306. fields {
  307. struct_literal {
  308. fields {
  309. name: "a"
  310. expression {
  311. int_literal {
  312. value: 2
  313. }
  314. }
  315. }
  316. }
  317. }
  318. fields {
  319. int_literal {
  320. value: 3
  321. }
  322. }
  323. }
  324. }
  325. }
  326. }
  327. }
  328. }
  329. }
  330. }
  331. }
  332. declarations {
  333. alias {
  334. name {
  335. name: "S"
  336. }
  337. target {
  338. struct_type_literal {
  339. fields {
  340. name: "a"
  341. expression {
  342. int_type_literal {
  343. }
  344. }
  345. }
  346. }
  347. }
  348. }
  349. }
  350. declarations {
  351. impl {
  352. kind: InternalImpl
  353. impl_type {
  354. call {
  355. function {
  356. identifier {
  357. name: "GenericClassAlias"
  358. }
  359. }
  360. argument {
  361. tuple_literal {
  362. fields {
  363. identifier {
  364. name: "S"
  365. }
  366. }
  367. }
  368. }
  369. }
  370. }
  371. interface {
  372. call {
  373. function {
  374. identifier {
  375. name: "GenericInterfaceAlias"
  376. }
  377. }
  378. argument {
  379. tuple_literal {
  380. fields {
  381. identifier {
  382. name: "S"
  383. }
  384. }
  385. }
  386. }
  387. }
  388. }
  389. members {
  390. function {
  391. name {
  392. name: "Make"
  393. }
  394. param_pattern {
  395. }
  396. return_term {
  397. kind: Expression
  398. type {
  399. tuple_literal {
  400. fields {
  401. identifier {
  402. name: "Self"
  403. }
  404. }
  405. fields {
  406. struct_type_literal {
  407. fields {
  408. name: "a"
  409. expression {
  410. int_type_literal {
  411. }
  412. }
  413. }
  414. }
  415. }
  416. }
  417. }
  418. }
  419. body {
  420. statements {
  421. return_expression_statement {
  422. expression {
  423. tuple_literal {
  424. fields {
  425. struct_literal {
  426. fields {
  427. name: "a"
  428. expression {
  429. struct_literal {
  430. fields {
  431. name: "a"
  432. expression {
  433. int_literal {
  434. value: 4
  435. }
  436. }
  437. }
  438. }
  439. }
  440. }
  441. }
  442. }
  443. fields {
  444. struct_literal {
  445. fields {
  446. name: "a"
  447. expression {
  448. int_literal {
  449. value: 5
  450. }
  451. }
  452. }
  453. }
  454. }
  455. }
  456. }
  457. }
  458. }
  459. }
  460. }
  461. }
  462. }
  463. }
  464. declarations {
  465. function {
  466. name {
  467. name: "CheckImplementsInterface"
  468. }
  469. deduced_parameters {
  470. name: "T"
  471. type {
  472. identifier {
  473. name: "Interface"
  474. }
  475. }
  476. }
  477. param_pattern {
  478. fields {
  479. binding_pattern {
  480. name: "x"
  481. type {
  482. expression_pattern {
  483. expression {
  484. identifier {
  485. name: "T"
  486. }
  487. }
  488. }
  489. }
  490. }
  491. }
  492. }
  493. return_term {
  494. kind: Expression
  495. type {
  496. identifier {
  497. name: "T"
  498. }
  499. }
  500. }
  501. body {
  502. statements {
  503. return_expression_statement {
  504. expression {
  505. call {
  506. function {
  507. simple_member_access {
  508. field: "Make"
  509. object {
  510. identifier {
  511. name: "T"
  512. }
  513. }
  514. }
  515. }
  516. argument {
  517. tuple_literal {
  518. }
  519. }
  520. }
  521. }
  522. }
  523. }
  524. }
  525. }
  526. }
  527. declarations {
  528. function {
  529. name {
  530. name: "CheckImplementsGenericInterface_i32"
  531. }
  532. deduced_parameters {
  533. name: "T"
  534. type {
  535. call {
  536. function {
  537. identifier {
  538. name: "GenericInterface"
  539. }
  540. }
  541. argument {
  542. tuple_literal {
  543. fields {
  544. int_type_literal {
  545. }
  546. }
  547. }
  548. }
  549. }
  550. }
  551. }
  552. param_pattern {
  553. fields {
  554. binding_pattern {
  555. name: "x"
  556. type {
  557. expression_pattern {
  558. expression {
  559. identifier {
  560. name: "T"
  561. }
  562. }
  563. }
  564. }
  565. }
  566. }
  567. }
  568. return_term {
  569. kind: Expression
  570. type {
  571. tuple_literal {
  572. fields {
  573. identifier {
  574. name: "T"
  575. }
  576. }
  577. fields {
  578. int_type_literal {
  579. }
  580. }
  581. }
  582. }
  583. }
  584. body {
  585. statements {
  586. return_expression_statement {
  587. expression {
  588. call {
  589. function {
  590. simple_member_access {
  591. field: "Make"
  592. object {
  593. identifier {
  594. name: "T"
  595. }
  596. }
  597. }
  598. }
  599. argument {
  600. tuple_literal {
  601. }
  602. }
  603. }
  604. }
  605. }
  606. }
  607. }
  608. }
  609. }
  610. declarations {
  611. function {
  612. name {
  613. name: "CheckImplementsGenericInterface_struct"
  614. }
  615. deduced_parameters {
  616. name: "T"
  617. type {
  618. call {
  619. function {
  620. identifier {
  621. name: "GenericInterface"
  622. }
  623. }
  624. argument {
  625. tuple_literal {
  626. fields {
  627. identifier {
  628. name: "S"
  629. }
  630. }
  631. }
  632. }
  633. }
  634. }
  635. }
  636. param_pattern {
  637. fields {
  638. binding_pattern {
  639. name: "x"
  640. type {
  641. expression_pattern {
  642. expression {
  643. identifier {
  644. name: "T"
  645. }
  646. }
  647. }
  648. }
  649. }
  650. }
  651. }
  652. return_term {
  653. kind: Expression
  654. type {
  655. tuple_literal {
  656. fields {
  657. identifier {
  658. name: "T"
  659. }
  660. }
  661. fields {
  662. identifier {
  663. name: "S"
  664. }
  665. }
  666. }
  667. }
  668. }
  669. body {
  670. statements {
  671. return_expression_statement {
  672. expression {
  673. call {
  674. function {
  675. simple_member_access {
  676. field: "Make"
  677. object {
  678. identifier {
  679. name: "T"
  680. }
  681. }
  682. }
  683. }
  684. argument {
  685. tuple_literal {
  686. }
  687. }
  688. }
  689. }
  690. }
  691. }
  692. }
  693. }
  694. }
  695. declarations {
  696. function {
  697. name {
  698. name: "Main"
  699. }
  700. param_pattern {
  701. }
  702. return_term {
  703. kind: Expression
  704. type {
  705. int_type_literal {
  706. }
  707. }
  708. }
  709. body {
  710. statements {
  711. variable_definition {
  712. pattern {
  713. binding_pattern {
  714. name: "a"
  715. type {
  716. expression_pattern {
  717. expression {
  718. identifier {
  719. name: "Class"
  720. }
  721. }
  722. }
  723. }
  724. }
  725. }
  726. init {
  727. struct_literal {
  728. fields {
  729. name: "a"
  730. expression {
  731. int_literal {
  732. value: 0
  733. }
  734. }
  735. }
  736. }
  737. }
  738. is_returned: false
  739. }
  740. }
  741. statements {
  742. assign {
  743. lhs {
  744. identifier {
  745. name: "a"
  746. }
  747. }
  748. rhs {
  749. call {
  750. function {
  751. identifier {
  752. name: "CheckImplementsInterface"
  753. }
  754. }
  755. argument {
  756. tuple_literal {
  757. fields {
  758. identifier {
  759. name: "a"
  760. }
  761. }
  762. }
  763. }
  764. }
  765. }
  766. op: Plain
  767. }
  768. }
  769. statements {
  770. variable_definition {
  771. pattern {
  772. binding_pattern {
  773. name: "b"
  774. type {
  775. expression_pattern {
  776. expression {
  777. call {
  778. function {
  779. identifier {
  780. name: "GenericClass"
  781. }
  782. }
  783. argument {
  784. tuple_literal {
  785. fields {
  786. int_type_literal {
  787. }
  788. }
  789. }
  790. }
  791. }
  792. }
  793. }
  794. }
  795. }
  796. }
  797. init {
  798. struct_literal {
  799. fields {
  800. name: "a"
  801. expression {
  802. int_literal {
  803. value: 0
  804. }
  805. }
  806. }
  807. }
  808. }
  809. is_returned: false
  810. }
  811. }
  812. statements {
  813. variable_definition {
  814. pattern {
  815. tuple_pattern {
  816. fields {
  817. binding_pattern {
  818. name: "b2"
  819. type {
  820. expression_pattern {
  821. expression {
  822. call {
  823. function {
  824. identifier {
  825. name: "GenericClass"
  826. }
  827. }
  828. argument {
  829. tuple_literal {
  830. fields {
  831. int_type_literal {
  832. }
  833. }
  834. }
  835. }
  836. }
  837. }
  838. }
  839. }
  840. }
  841. }
  842. fields {
  843. binding_pattern {
  844. name: "n"
  845. type {
  846. expression_pattern {
  847. expression {
  848. int_type_literal {
  849. }
  850. }
  851. }
  852. }
  853. }
  854. }
  855. }
  856. }
  857. init {
  858. call {
  859. function {
  860. identifier {
  861. name: "CheckImplementsGenericInterface_i32"
  862. }
  863. }
  864. argument {
  865. tuple_literal {
  866. fields {
  867. identifier {
  868. name: "b"
  869. }
  870. }
  871. }
  872. }
  873. }
  874. }
  875. is_returned: false
  876. }
  877. }
  878. statements {
  879. variable_definition {
  880. pattern {
  881. binding_pattern {
  882. name: "c"
  883. type {
  884. expression_pattern {
  885. expression {
  886. call {
  887. function {
  888. identifier {
  889. name: "GenericClass"
  890. }
  891. }
  892. argument {
  893. tuple_literal {
  894. fields {
  895. struct_type_literal {
  896. fields {
  897. name: "a"
  898. expression {
  899. int_type_literal {
  900. }
  901. }
  902. }
  903. }
  904. }
  905. }
  906. }
  907. }
  908. }
  909. }
  910. }
  911. }
  912. }
  913. init {
  914. struct_literal {
  915. fields {
  916. name: "a"
  917. expression {
  918. struct_literal {
  919. fields {
  920. name: "a"
  921. expression {
  922. int_literal {
  923. value: 0
  924. }
  925. }
  926. }
  927. }
  928. }
  929. }
  930. }
  931. }
  932. is_returned: false
  933. }
  934. }
  935. statements {
  936. variable_definition {
  937. pattern {
  938. tuple_pattern {
  939. fields {
  940. binding_pattern {
  941. name: "c2"
  942. type {
  943. expression_pattern {
  944. expression {
  945. call {
  946. function {
  947. identifier {
  948. name: "GenericClass"
  949. }
  950. }
  951. argument {
  952. tuple_literal {
  953. fields {
  954. struct_type_literal {
  955. fields {
  956. name: "a"
  957. expression {
  958. int_type_literal {
  959. }
  960. }
  961. }
  962. }
  963. }
  964. }
  965. }
  966. }
  967. }
  968. }
  969. }
  970. }
  971. }
  972. fields {
  973. binding_pattern {
  974. name: "s"
  975. type {
  976. expression_pattern {
  977. expression {
  978. identifier {
  979. name: "S"
  980. }
  981. }
  982. }
  983. }
  984. }
  985. }
  986. }
  987. }
  988. init {
  989. call {
  990. function {
  991. identifier {
  992. name: "CheckImplementsGenericInterface_struct"
  993. }
  994. }
  995. argument {
  996. tuple_literal {
  997. fields {
  998. identifier {
  999. name: "c"
  1000. }
  1001. }
  1002. }
  1003. }
  1004. }
  1005. }
  1006. is_returned: false
  1007. }
  1008. }
  1009. statements {
  1010. return_expression_statement {
  1011. expression {
  1012. operator {
  1013. op: Add
  1014. arguments {
  1015. operator {
  1016. op: Add
  1017. arguments {
  1018. operator {
  1019. op: Add
  1020. arguments {
  1021. operator {
  1022. op: Add
  1023. arguments {
  1024. operator {
  1025. op: Mul
  1026. arguments {
  1027. int_literal {
  1028. value: 10000
  1029. }
  1030. }
  1031. arguments {
  1032. simple_member_access {
  1033. field: "a"
  1034. object {
  1035. identifier {
  1036. name: "a"
  1037. }
  1038. }
  1039. }
  1040. }
  1041. }
  1042. }
  1043. arguments {
  1044. operator {
  1045. op: Mul
  1046. arguments {
  1047. int_literal {
  1048. value: 1000
  1049. }
  1050. }
  1051. arguments {
  1052. simple_member_access {
  1053. field: "a"
  1054. object {
  1055. identifier {
  1056. name: "b2"
  1057. }
  1058. }
  1059. }
  1060. }
  1061. }
  1062. }
  1063. }
  1064. }
  1065. arguments {
  1066. operator {
  1067. op: Mul
  1068. arguments {
  1069. int_literal {
  1070. value: 100
  1071. }
  1072. }
  1073. arguments {
  1074. identifier {
  1075. name: "n"
  1076. }
  1077. }
  1078. }
  1079. }
  1080. }
  1081. }
  1082. arguments {
  1083. operator {
  1084. op: Mul
  1085. arguments {
  1086. int_literal {
  1087. value: 10
  1088. }
  1089. }
  1090. arguments {
  1091. simple_member_access {
  1092. field: "a"
  1093. object {
  1094. simple_member_access {
  1095. field: "a"
  1096. object {
  1097. identifier {
  1098. name: "c2"
  1099. }
  1100. }
  1101. }
  1102. }
  1103. }
  1104. }
  1105. }
  1106. }
  1107. }
  1108. }
  1109. arguments {
  1110. simple_member_access {
  1111. field: "a"
  1112. object {
  1113. identifier {
  1114. name: "s"
  1115. }
  1116. }
  1117. }
  1118. }
  1119. }
  1120. }
  1121. }
  1122. }
  1123. }
  1124. }
  1125. }
  1126. }