tsc-ts 0.0.9 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/README.md +2 -2
  2. package/bin/tsc-ts.js +70 -1
  3. package/dist/api/compiler/ast-utilities.d.ts +19 -1
  4. package/dist/api/compiler/ast-utilities.js +180 -95
  5. package/dist/api/compiler/ast.d.ts +22 -15
  6. package/dist/api/compiler/ast.js +1026 -995
  7. package/dist/api/compiler/astnav.js +15 -15
  8. package/dist/api/compiler/binder-utilities.js +186 -186
  9. package/dist/api/compiler/binder.js +290 -263
  10. package/dist/api/compiler/character-codes.js +2 -2
  11. package/dist/api/compiler/checker-calls.js +178 -124
  12. package/dist/api/compiler/checker-classes.d.ts +14 -3
  13. package/dist/api/compiler/checker-classes.js +134 -90
  14. package/dist/api/compiler/checker-contextual.js +64 -61
  15. package/dist/api/compiler/checker-declaration-order.js +79 -79
  16. package/dist/api/compiler/checker-declarations.d.ts +1 -0
  17. package/dist/api/compiler/checker-declarations.js +160 -136
  18. package/dist/api/compiler/checker-declared-types.js +67 -65
  19. package/dist/api/compiler/checker-decorators.js +77 -77
  20. package/dist/api/compiler/checker-deprecation.d.ts +8 -3
  21. package/dist/api/compiler/checker-deprecation.js +76 -55
  22. package/dist/api/compiler/checker-destructuring.js +47 -45
  23. package/dist/api/compiler/checker-elaboration.js +24 -24
  24. package/dist/api/compiler/checker-emit-helpers.js +4 -4
  25. package/dist/api/compiler/checker-emit-resolver.d.ts +4 -2
  26. package/dist/api/compiler/checker-emit-resolver.js +25 -13
  27. package/dist/api/compiler/checker-evaluator.js +9 -9
  28. package/dist/api/compiler/checker-expressions.js +244 -211
  29. package/dist/api/compiler/checker-functions.js +113 -107
  30. package/dist/api/compiler/checker-generated-code.d.ts +0 -11
  31. package/dist/api/compiler/checker-generated-code.js +28 -52
  32. package/dist/api/compiler/checker-grammar.d.ts +1 -0
  33. package/dist/api/compiler/checker-grammar.js +472 -440
  34. package/dist/api/compiler/checker-heritage.js +91 -93
  35. package/dist/api/compiler/checker-inference.d.ts +77 -5
  36. package/dist/api/compiler/checker-inference.js +487 -107
  37. package/dist/api/compiler/checker-iteration.d.ts +0 -10
  38. package/dist/api/compiler/checker-iteration.js +35 -52
  39. package/dist/api/compiler/checker-javascript.js +14 -14
  40. package/dist/api/compiler/checker-jsdoc.d.ts +8 -10
  41. package/dist/api/compiler/checker-jsdoc.js +67 -58
  42. package/dist/api/compiler/checker-jsx.js +105 -88
  43. package/dist/api/compiler/checker-members.d.ts +9 -2
  44. package/dist/api/compiler/checker-members.js +212 -75
  45. package/dist/api/compiler/checker-modules.d.ts +15 -6
  46. package/dist/api/compiler/checker-modules.js +469 -309
  47. package/dist/api/compiler/checker-narrowing.js +273 -189
  48. package/dist/api/compiler/checker-object-literals.js +25 -22
  49. package/dist/api/compiler/checker-operators.js +126 -118
  50. package/dist/api/compiler/checker-overloads.js +27 -27
  51. package/dist/api/compiler/checker-property-access.js +59 -55
  52. package/dist/api/compiler/checker-services.d.ts +1 -0
  53. package/dist/api/compiler/checker-services.js +222 -210
  54. package/dist/api/compiler/checker-signatures.js +65 -49
  55. package/dist/api/compiler/checker-source-file.d.ts +5 -0
  56. package/dist/api/compiler/checker-source-file.js +154 -130
  57. package/dist/api/compiler/checker-statements.js +33 -32
  58. package/dist/api/compiler/checker-super.js +50 -50
  59. package/dist/api/compiler/checker-symbol-types.js +109 -93
  60. package/dist/api/compiler/checker-symbols.d.ts +13 -1
  61. package/dist/api/compiler/checker-symbols.js +264 -149
  62. package/dist/api/compiler/checker-type-factory.d.ts +5 -0
  63. package/dist/api/compiler/checker-type-factory.js +145 -36
  64. package/dist/api/compiler/checker-type-nodes.d.ts +1 -0
  65. package/dist/api/compiler/checker-type-nodes.js +179 -141
  66. package/dist/api/compiler/checker-type-operators.d.ts +2 -0
  67. package/dist/api/compiler/checker-type-operators.js +110 -63
  68. package/dist/api/compiler/checker-types.d.ts +80 -3
  69. package/dist/api/compiler/checker-types.js +121 -2
  70. package/dist/api/compiler/checker-unused.js +114 -118
  71. package/dist/api/compiler/checker-utilities.js +11 -11
  72. package/dist/api/compiler/checker.d.ts +104 -31
  73. package/dist/api/compiler/checker.js +181 -33
  74. package/dist/api/compiler/command-line.d.ts +1 -3
  75. package/dist/api/compiler/command-line.js +47 -44
  76. package/dist/api/compiler/compile-program.d.ts +42 -3
  77. package/dist/api/compiler/compile-program.js +139 -27
  78. package/dist/api/compiler/diagnostic-messages.d.ts +1849 -1774
  79. package/dist/api/compiler/diagnostic-messages.js +128 -122
  80. package/dist/api/compiler/diagnostics.d.ts +22 -0
  81. package/dist/api/compiler/diagnostics.js +93 -11
  82. package/dist/api/compiler/emitter.d.ts +7 -1
  83. package/dist/api/compiler/emitter.js +53 -11
  84. package/dist/api/compiler/file-include.d.ts +2 -1
  85. package/dist/api/compiler/file-include.js +11 -7
  86. package/dist/api/compiler/file-loader.d.ts +21 -1
  87. package/dist/api/compiler/file-loader.js +201 -48
  88. package/dist/api/compiler/instantiation.d.ts +7 -0
  89. package/dist/api/compiler/instantiation.js +101 -49
  90. package/dist/api/compiler/jsdoc.js +23 -23
  91. package/dist/api/compiler/link-tables.d.ts +48 -18
  92. package/dist/api/compiler/link-tables.js +80 -37
  93. package/dist/api/compiler/locales/cs-CZ.d.ts +1 -1
  94. package/dist/api/compiler/locales/cs-CZ.js +1 -1
  95. package/dist/api/compiler/locales/de-DE.d.ts +1 -1
  96. package/dist/api/compiler/locales/de-DE.js +1 -1
  97. package/dist/api/compiler/locales/es-ES.d.ts +1 -1
  98. package/dist/api/compiler/locales/es-ES.js +1 -1
  99. package/dist/api/compiler/locales/fr-FR.d.ts +1 -1
  100. package/dist/api/compiler/locales/fr-FR.js +1 -1
  101. package/dist/api/compiler/locales/it-IT.d.ts +1 -1
  102. package/dist/api/compiler/locales/it-IT.js +1 -1
  103. package/dist/api/compiler/locales/ja-JP.d.ts +1 -1
  104. package/dist/api/compiler/locales/ja-JP.js +1 -1
  105. package/dist/api/compiler/locales/ko-KR.d.ts +1 -1
  106. package/dist/api/compiler/locales/ko-KR.js +1 -1
  107. package/dist/api/compiler/locales/pl-PL.d.ts +1 -1
  108. package/dist/api/compiler/locales/pl-PL.js +1 -1
  109. package/dist/api/compiler/locales/pt-BR.d.ts +1 -1
  110. package/dist/api/compiler/locales/pt-BR.js +1 -1
  111. package/dist/api/compiler/locales/ru-RU.d.ts +1 -1
  112. package/dist/api/compiler/locales/ru-RU.js +1 -1
  113. package/dist/api/compiler/locales/tr-TR.d.ts +1 -1
  114. package/dist/api/compiler/locales/tr-TR.js +1 -1
  115. package/dist/api/compiler/locales/zh-CN.d.ts +1 -1
  116. package/dist/api/compiler/locales/zh-CN.js +1 -1
  117. package/dist/api/compiler/locales/zh-TW.d.ts +1 -1
  118. package/dist/api/compiler/locales/zh-TW.js +1 -1
  119. package/dist/api/compiler/module-resolution-types.js +6 -6
  120. package/dist/api/compiler/module-resolution.d.ts +10 -1
  121. package/dist/api/compiler/module-resolution.js +115 -84
  122. package/dist/api/compiler/module-specifiers.d.ts +15 -0
  123. package/dist/api/compiler/module-specifiers.js +24 -18
  124. package/dist/api/compiler/name-resolver.js +74 -65
  125. package/dist/api/compiler/node-builder-names.d.ts +11 -3
  126. package/dist/api/compiler/node-builder-names.js +210 -90
  127. package/dist/api/compiler/node-builder-pseudo.js +29 -31
  128. package/dist/api/compiler/node-builder-reuse.js +23 -22
  129. package/dist/api/compiler/node-builder.d.ts +18 -1
  130. package/dist/api/compiler/node-builder.js +191 -102
  131. package/dist/api/compiler/option-declarations.d.ts +2 -6
  132. package/dist/api/compiler/option-declarations.js +315 -375
  133. package/dist/api/compiler/options.d.ts +15 -33
  134. package/dist/api/compiler/options.js +21 -54
  135. package/dist/api/compiler/output-paths.d.ts +4 -1
  136. package/dist/api/compiler/output-paths.js +6 -11
  137. package/dist/api/compiler/package-json.d.ts +3 -3
  138. package/dist/api/compiler/package-json.js +11 -10
  139. package/dist/api/compiler/parallel-parse.d.ts +3 -2
  140. package/dist/api/compiler/parallel-parse.js +17 -5
  141. package/dist/api/compiler/parser.d.ts +40 -19
  142. package/dist/api/compiler/parser.js +308 -216
  143. package/dist/api/compiler/path.d.ts +9 -0
  144. package/dist/api/compiler/path.js +20 -3
  145. package/dist/api/compiler/printer/emit-context.d.ts +5 -1
  146. package/dist/api/compiler/printer/emit-context.js +20 -1
  147. package/dist/api/compiler/printer/factory-base.d.ts +2 -2
  148. package/dist/api/compiler/printer/factory-base.js +7 -3
  149. package/dist/api/compiler/printer/factory.js +3 -1
  150. package/dist/api/compiler/printer/helpers.js +10 -1
  151. package/dist/api/compiler/printer/name-generator.d.ts +1 -1
  152. package/dist/api/compiler/printer/name-generator.js +35 -16
  153. package/dist/api/compiler/printer/printer.d.ts +49 -2
  154. package/dist/api/compiler/printer/printer.js +539 -293
  155. package/dist/api/compiler/printer/utilities.js +149 -147
  156. package/dist/api/compiler/program-checker.d.ts +12 -2
  157. package/dist/api/compiler/program-checker.js +88 -34
  158. package/dist/api/compiler/program-utilities.d.ts +3 -1
  159. package/dist/api/compiler/program-utilities.js +28 -15
  160. package/dist/api/compiler/program.d.ts +4 -6
  161. package/dist/api/compiler/program.js +74 -87
  162. package/dist/api/compiler/pseudo-bigint.d.ts +2 -0
  163. package/dist/api/compiler/pseudo-bigint.js +18 -0
  164. package/dist/api/compiler/regexp-checker.d.ts +1 -1
  165. package/dist/api/compiler/regexp-checker.js +93 -76
  166. package/dist/api/compiler/relations.d.ts +27 -4
  167. package/dist/api/compiler/relations.js +347 -180
  168. package/dist/api/compiler/reparser.js +60 -56
  169. package/dist/api/compiler/scanner.d.ts +19 -2
  170. package/dist/api/compiler/scanner.js +123 -108
  171. package/dist/api/compiler/shared-results.d.ts +463 -0
  172. package/dist/api/compiler/shared-results.js +2128 -0
  173. package/dist/api/compiler/sourcemap.js +2 -2
  174. package/dist/api/compiler/symbol-accessibility.js +87 -74
  175. package/dist/api/compiler/symbol.d.ts +23 -14
  176. package/dist/api/compiler/symbol.js +23 -11
  177. package/dist/api/compiler/syntax-kind.d.ts +198 -197
  178. package/dist/api/compiler/transformers/alias-references.js +247 -139
  179. package/dist/api/compiler/transformers/async-utilities.js +25 -25
  180. package/dist/api/compiler/transformers/async.d.ts +0 -1
  181. package/dist/api/compiler/transformers/async.js +64 -77
  182. package/dist/api/compiler/transformers/class-fields.d.ts +1 -0
  183. package/dist/api/compiler/transformers/class-fields.js +81 -78
  184. package/dist/api/compiler/transformers/commonjs-module.js +18 -15
  185. package/dist/api/compiler/transformers/const-enum-inliner.js +1 -1
  186. package/dist/api/compiler/transformers/declarations-diagnostics.js +247 -244
  187. package/dist/api/compiler/transformers/declarations-pseudo.js +100 -100
  188. package/dist/api/compiler/transformers/declarations-resolver.d.ts +0 -3
  189. package/dist/api/compiler/transformers/declarations-syntactic.d.ts +1 -2
  190. package/dist/api/compiler/transformers/declarations-syntactic.js +134 -156
  191. package/dist/api/compiler/transformers/declarations-tracker.js +18 -18
  192. package/dist/api/compiler/transformers/declarations.d.ts +4 -1
  193. package/dist/api/compiler/transformers/declarations.js +305 -238
  194. package/dist/api/compiler/transformers/decorator-metadata.d.ts +1 -1
  195. package/dist/api/compiler/transformers/decorator-metadata.js +53 -45
  196. package/dist/api/compiler/transformers/decorator-utilities.js +24 -24
  197. package/dist/api/compiler/transformers/destructuring.js +19 -18
  198. package/dist/api/compiler/transformers/emit-resolver.js +1 -1
  199. package/dist/api/compiler/transformers/es-decorators.js +55 -55
  200. package/dist/api/compiler/transformers/external-module-info.js +3 -3
  201. package/dist/api/compiler/transformers/for-await.js +25 -25
  202. package/dist/api/compiler/transformers/import-elision.js +14 -14
  203. package/dist/api/compiler/transformers/jsx.js +12 -12
  204. package/dist/api/compiler/transformers/legacy-decorators.js +17 -17
  205. package/dist/api/compiler/transformers/module.js +8 -8
  206. package/dist/api/compiler/transformers/named-evaluation.js +4 -4
  207. package/dist/api/compiler/transformers/object-rest-spread.js +20 -20
  208. package/dist/api/compiler/transformers/optional-chain.js +10 -10
  209. package/dist/api/compiler/transformers/reference-resolver.d.ts +12 -1
  210. package/dist/api/compiler/transformers/reference-resolver.js +131 -69
  211. package/dist/api/compiler/transformers/runtime-syntax.js +35 -31
  212. package/dist/api/compiler/transformers/subtree-facts.js +47 -47
  213. package/dist/api/compiler/transformers/syntax-facts.js +56 -58
  214. package/dist/api/compiler/transformers/type-eraser.js +73 -66
  215. package/dist/api/compiler/transformers/type-serialization.js +24 -24
  216. package/dist/api/compiler/transformers/using.js +12 -12
  217. package/dist/api/compiler/transformers/utilities.js +77 -77
  218. package/dist/api/compiler/transformers/visitor-base.js +172 -172
  219. package/dist/api/compiler/transformers/visitor-hooks.js +6 -2
  220. package/dist/api/compiler/tsconfig.d.ts +10 -2
  221. package/dist/api/compiler/tsconfig.js +136 -48
  222. package/dist/api/compiler/type-printer.js +40 -3
  223. package/dist/api/compiler/types.d.ts +2 -1
  224. package/dist/api/library/ast.generated.d.ts +42 -39
  225. package/dist/api/library/ast.generated.js +1 -1
  226. package/dist/api/library/compiler-options.generated.d.ts +111 -100
  227. package/dist/api/library/compiler-options.generated.js +1 -1
  228. package/dist/api/library/disk.js +12 -1
  229. package/dist/api/library/enums.generated.d.ts +206 -206
  230. package/dist/api/library/enums.generated.js +206 -206
  231. package/dist/api/library/nodes.js +26 -26
  232. package/package.json +9 -9
  233. package/src/compiler/ast-utilities.ts +99 -7
  234. package/src/compiler/ast.ts +58 -26
  235. package/src/compiler/binder.ts +39 -4
  236. package/src/compiler/character-codes.ts +2 -2
  237. package/src/compiler/checker-calls.ts +79 -9
  238. package/src/compiler/checker-classes.ts +78 -24
  239. package/src/compiler/checker-contextual.ts +6 -1
  240. package/src/compiler/checker-declarations.ts +31 -4
  241. package/src/compiler/checker-declared-types.ts +8 -5
  242. package/src/compiler/checker-decorators.ts +1 -1
  243. package/src/compiler/checker-deprecation.ts +29 -8
  244. package/src/compiler/checker-destructuring.ts +10 -3
  245. package/src/compiler/checker-emit-helpers.ts +1 -0
  246. package/src/compiler/checker-emit-resolver.ts +16 -6
  247. package/src/compiler/checker-expressions.ts +79 -46
  248. package/src/compiler/checker-functions.ts +21 -6
  249. package/src/compiler/checker-generated-code.ts +2 -22
  250. package/src/compiler/checker-grammar.ts +136 -62
  251. package/src/compiler/checker-heritage.ts +22 -21
  252. package/src/compiler/checker-inference.ts +514 -82
  253. package/src/compiler/checker-iteration.ts +18 -31
  254. package/src/compiler/checker-javascript.ts +1 -1
  255. package/src/compiler/checker-jsdoc.ts +50 -27
  256. package/src/compiler/checker-jsx.ts +26 -4
  257. package/src/compiler/checker-members.ts +200 -56
  258. package/src/compiler/checker-modules.ts +332 -65
  259. package/src/compiler/checker-narrowing.ts +98 -19
  260. package/src/compiler/checker-object-literals.ts +3 -0
  261. package/src/compiler/checker-operators.ts +11 -4
  262. package/src/compiler/checker-property-access.ts +7 -2
  263. package/src/compiler/checker-services.ts +39 -12
  264. package/src/compiler/checker-signatures.ts +15 -1
  265. package/src/compiler/checker-source-file.ts +39 -13
  266. package/src/compiler/checker-statements.ts +3 -2
  267. package/src/compiler/checker-symbol-types.ts +29 -6
  268. package/src/compiler/checker-symbols.ts +158 -15
  269. package/src/compiler/checker-type-factory.ts +124 -23
  270. package/src/compiler/checker-type-nodes.ts +46 -3
  271. package/src/compiler/checker-type-operators.ts +83 -26
  272. package/src/compiler/checker-types.ts +147 -4
  273. package/src/compiler/checker-unused.ts +9 -14
  274. package/src/compiler/checker.ts +203 -39
  275. package/src/compiler/command-line.ts +28 -28
  276. package/src/compiler/compile-program.ts +167 -27
  277. package/src/compiler/decoder.ts +13 -4
  278. package/src/compiler/diagnostic-messages.ts +1973 -1892
  279. package/src/compiler/diagnostics.ts +84 -3
  280. package/src/compiler/emitter.ts +57 -8
  281. package/src/compiler/encoder.ts +23 -8
  282. package/src/compiler/file-include.ts +9 -3
  283. package/src/compiler/file-loader.ts +197 -38
  284. package/src/compiler/help.ts +10 -14
  285. package/src/compiler/incremental.ts +165 -30
  286. package/src/compiler/init.ts +2 -7
  287. package/src/compiler/instantiation.ts +77 -22
  288. package/src/compiler/jsdoc.ts +3 -1
  289. package/src/compiler/link-tables.ts +82 -37
  290. package/src/compiler/locales/cs-CZ.ts +1 -1
  291. package/src/compiler/locales/de-DE.ts +1 -1
  292. package/src/compiler/locales/es-ES.ts +1 -1
  293. package/src/compiler/locales/fr-FR.ts +1 -1
  294. package/src/compiler/locales/it-IT.ts +1 -1
  295. package/src/compiler/locales/ja-JP.ts +1 -1
  296. package/src/compiler/locales/ko-KR.ts +1 -1
  297. package/src/compiler/locales/pl-PL.ts +1 -1
  298. package/src/compiler/locales/pt-BR.ts +1 -1
  299. package/src/compiler/locales/ru-RU.ts +1 -1
  300. package/src/compiler/locales/tr-TR.ts +1 -1
  301. package/src/compiler/locales/zh-CN.ts +1 -1
  302. package/src/compiler/locales/zh-TW.ts +1 -1
  303. package/src/compiler/module-resolution.ts +44 -8
  304. package/src/compiler/module-specifiers.ts +62 -20
  305. package/src/compiler/name-resolver.ts +9 -1
  306. package/src/compiler/node-builder-names.ts +236 -54
  307. package/src/compiler/node-builder-pseudo.ts +4 -7
  308. package/src/compiler/node-builder-reuse.ts +5 -4
  309. package/src/compiler/node-builder.ts +130 -31
  310. package/src/compiler/option-declarations.ts +33 -103
  311. package/src/compiler/options.ts +23 -62
  312. package/src/compiler/output-paths.ts +5 -18
  313. package/src/compiler/package-entrypoints.ts +345 -0
  314. package/src/compiler/package-json.ts +4 -4
  315. package/src/compiler/parallel-check.ts +326 -52
  316. package/src/compiler/parallel-emit.ts +320 -0
  317. package/src/compiler/parallel-parse.ts +16 -5
  318. package/src/compiler/parse-thread.ts +3 -0
  319. package/src/compiler/parser.ts +156 -39
  320. package/src/compiler/path.ts +22 -2
  321. package/src/compiler/printer/emit-context.ts +21 -0
  322. package/src/compiler/printer/factory-base.ts +10 -3
  323. package/src/compiler/printer/factory.ts +4 -1
  324. package/src/compiler/printer/helpers.ts +10 -1
  325. package/src/compiler/printer/name-generator.ts +24 -2
  326. package/src/compiler/printer/printer.ts +266 -30
  327. package/src/compiler/printer/utilities.ts +8 -2
  328. package/src/compiler/program-checker.ts +57 -5
  329. package/src/compiler/program-utilities.ts +23 -10
  330. package/src/compiler/program.ts +18 -26
  331. package/src/compiler/pseudo-bigint.ts +17 -0
  332. package/src/compiler/regexp-checker.ts +63 -30
  333. package/src/compiler/relations.ts +240 -77
  334. package/src/compiler/reparser.ts +7 -2
  335. package/src/compiler/scanner.ts +109 -79
  336. package/src/compiler/shared-results.ts +2414 -0
  337. package/src/compiler/show-config.ts +18 -1
  338. package/src/compiler/sourcemap.ts +2 -2
  339. package/src/compiler/symbol-accessibility.ts +26 -3
  340. package/src/compiler/symbol.ts +46 -24
  341. package/src/compiler/syntax-kind.ts +188 -187
  342. package/src/compiler/thread-entry.ts +64 -4
  343. package/src/compiler/transformers/alias-references.ts +123 -4
  344. package/src/compiler/transformers/async.ts +2 -17
  345. package/src/compiler/transformers/class-fields.ts +13 -12
  346. package/src/compiler/transformers/commonjs-module.ts +11 -7
  347. package/src/compiler/transformers/declarations-diagnostics.ts +5 -3
  348. package/src/compiler/transformers/declarations-pseudo.ts +2 -4
  349. package/src/compiler/transformers/declarations-resolver.ts +0 -3
  350. package/src/compiler/transformers/declarations-syntactic.ts +1 -21
  351. package/src/compiler/transformers/declarations.ts +134 -48
  352. package/src/compiler/transformers/decorator-metadata.ts +9 -1
  353. package/src/compiler/transformers/destructuring.ts +4 -3
  354. package/src/compiler/transformers/external-module-info.ts +1 -1
  355. package/src/compiler/transformers/jsx.ts +2 -1
  356. package/src/compiler/transformers/reference-resolver.ts +83 -19
  357. package/src/compiler/transformers/runtime-syntax.ts +6 -1
  358. package/src/compiler/transformers/syntax-facts.ts +2 -7
  359. package/src/compiler/transformers/type-eraser.ts +10 -1
  360. package/src/compiler/transformers/type-serialization.ts +3 -2
  361. package/src/compiler/transformers/visitor-base.ts +2 -1
  362. package/src/compiler/transformers/visitor-hooks.ts +9 -4
  363. package/src/compiler/tsc-build.ts +66 -9
  364. package/src/compiler/tsc-cli.ts +7 -0
  365. package/src/compiler/tsc-compile.ts +284 -4
  366. package/src/compiler/tsc-watch.ts +74 -45
  367. package/src/compiler/tsconfig.ts +176 -19
  368. package/src/compiler/type-printer.ts +36 -2
  369. package/src/compiler/types.ts +2 -1
  370. package/src/library/ast.generated.ts +57 -41
  371. package/src/library/compiler-options.generated.ts +117 -103
  372. package/src/library/disk.ts +10 -1
  373. package/src/library/enums.generated.ts +196 -196
@@ -1,10 +1,11 @@
1
1
  // Declaration emit errors: names that can't be written in a declaration file, and types that
2
2
  // `isolatedDeclarations` can't write without inference.
3
3
  import { CallExpression, HeritageClause, ParameterDeclaration, SetAccessorDeclaration, getInitializer, getName, getParameters, getSymbol, getType, } from '../ast.js';
4
- import { declarationNameToString, getErrorRangeForNode, getNameOfDeclaration, getSourceFileOfNode, getSourceTextOfNode, hasSyntacticModifier, isEntityNameExpression, isStatic, isTypeNodeKind, } from '../binder-utilities.js';
4
+ import { declarationNameToString, getErrorRangeForNode, getNameOfDeclaration, getSourceFileOfNode, getSourceTextOfNode, hasSyntacticModifier, isEntityNameExpression, isStatic, } from '../binder-utilities.js';
5
5
  import { isFunctionLikeDeclarationKind } from '../ast-utilities.js';
6
6
  import { Diagnostic } from '../diagnostics.js';
7
7
  import { isStatement } from '../printer/utilities.js';
8
+ import { isPartOfTypeNode } from './alias-references.js';
8
9
  import { isParameterPropertyDeclaration } from './utilities.js';
9
10
  import { getDeclarations } from '../symbol.js';
10
11
  export function createDiagnosticForNode(node, message, args) {
@@ -52,29 +53,29 @@ export class SymbolAccessibilityDiagnostic {
52
53
  /** Whether a declaration of this kind can report inaccessible names in its type. */
53
54
  export function canProduceDiagnostics(node) {
54
55
  switch (node.kind) {
55
- case 261 /* SyntaxKind.VariableDeclaration */:
56
- case 173 /* SyntaxKind.PropertyDeclaration */:
57
- case 172 /* SyntaxKind.PropertySignature */:
58
- case 209 /* SyntaxKind.BindingElement */:
59
- case 179 /* SyntaxKind.SetAccessor */:
60
- case 178 /* SyntaxKind.GetAccessor */:
61
- case 181 /* SyntaxKind.ConstructSignature */:
62
- case 180 /* SyntaxKind.CallSignature */:
63
- case 175 /* SyntaxKind.MethodDeclaration */:
64
- case 174 /* SyntaxKind.MethodSignature */:
65
- case 263 /* SyntaxKind.FunctionDeclaration */:
66
- case 170 /* SyntaxKind.Parameter */:
67
- case 169 /* SyntaxKind.TypeParameter */:
68
- case 234 /* SyntaxKind.ExpressionWithTypeArguments */:
69
- case 272 /* SyntaxKind.ImportEqualsDeclaration */:
70
- case 266 /* SyntaxKind.TypeAliasDeclaration */:
71
- case 345 /* SyntaxKind.JSTypeAliasDeclaration */:
72
- case 177 /* SyntaxKind.Constructor */:
73
- case 182 /* SyntaxKind.IndexSignature */:
74
- case 212 /* SyntaxKind.PropertyAccessExpression */:
75
- case 213 /* SyntaxKind.ElementAccessExpression */:
76
- case 227 /* SyntaxKind.BinaryExpression */:
77
- case 214 /* SyntaxKind.CallExpression */:
56
+ case 262 /* SyntaxKind.VariableDeclaration */:
57
+ case 174 /* SyntaxKind.PropertyDeclaration */:
58
+ case 173 /* SyntaxKind.PropertySignature */:
59
+ case 210 /* SyntaxKind.BindingElement */:
60
+ case 180 /* SyntaxKind.SetAccessor */:
61
+ case 179 /* SyntaxKind.GetAccessor */:
62
+ case 182 /* SyntaxKind.ConstructSignature */:
63
+ case 181 /* SyntaxKind.CallSignature */:
64
+ case 176 /* SyntaxKind.MethodDeclaration */:
65
+ case 175 /* SyntaxKind.MethodSignature */:
66
+ case 264 /* SyntaxKind.FunctionDeclaration */:
67
+ case 171 /* SyntaxKind.Parameter */:
68
+ case 170 /* SyntaxKind.TypeParameter */:
69
+ case 235 /* SyntaxKind.ExpressionWithTypeArguments */:
70
+ case 273 /* SyntaxKind.ImportEqualsDeclaration */:
71
+ case 267 /* SyntaxKind.TypeAliasDeclaration */:
72
+ case 346 /* SyntaxKind.JSTypeAliasDeclaration */:
73
+ case 178 /* SyntaxKind.Constructor */:
74
+ case 183 /* SyntaxKind.IndexSignature */:
75
+ case 213 /* SyntaxKind.PropertyAccessExpression */:
76
+ case 214 /* SyntaxKind.ElementAccessExpression */:
77
+ case 228 /* SyntaxKind.BinaryExpression */:
78
+ case 215 /* SyntaxKind.CallExpression */:
78
79
  return true;
79
80
  }
80
81
  return false;
@@ -86,13 +87,13 @@ export function getSymbolAccessibilityDiagnostic(context, result) {
86
87
  case 0 /* DiagnosticContextKind.None */:
87
88
  throw new Error('Diagnostic emitted without context');
88
89
  case 3 /* DiagnosticContextKind.DefaultExport */:
89
- return new SymbolAccessibilityDiagnostic(node, 1074 /* Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0 */, undefined);
90
+ return new SymbolAccessibilityDiagnostic(node, 1081 /* Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0 */, undefined);
90
91
  case 4 /* DiagnosticContextKind.ExtendsExpression */:
91
- return new SymbolAccessibilityDiagnostic(node, 1014 /* Diagnostics.X_extends_clause_of_exported_class_0_has_or_is_using_private_name_1 */, context.typeName);
92
+ return new SymbolAccessibilityDiagnostic(node, 1021 /* Diagnostics.X_extends_clause_of_exported_class_0_has_or_is_using_private_name_1 */, context.typeName);
92
93
  case 2 /* DiagnosticContextKind.DeclarationName */:
93
- if (node.kind === 178 /* SyntaxKind.GetAccessor */ || node.kind === 179 /* SyntaxKind.SetAccessor */)
94
+ if (node.kind === 179 /* SyntaxKind.GetAccessor */ || node.kind === 180 /* SyntaxKind.SetAccessor */)
94
95
  return simple(node, accessorNameMessage(node, result));
95
- if (node.kind === 175 /* SyntaxKind.MethodDeclaration */ || node.kind === 174 /* SyntaxKind.MethodSignature */)
96
+ if (node.kind === 176 /* SyntaxKind.MethodDeclaration */ || node.kind === 175 /* SyntaxKind.MethodSignature */)
96
97
  return simple(node, methodNameMessage(node, result));
97
98
  return forDeclaration(node, result);
98
99
  case 1 /* DiagnosticContextKind.Declaration */:
@@ -106,53 +107,53 @@ function simple(node, message) {
106
107
  }
107
108
  function forDeclaration(node, result) {
108
109
  switch (node.kind) {
109
- case 261 /* SyntaxKind.VariableDeclaration */:
110
- case 173 /* SyntaxKind.PropertyDeclaration */:
111
- case 172 /* SyntaxKind.PropertySignature */:
112
- case 212 /* SyntaxKind.PropertyAccessExpression */:
113
- case 213 /* SyntaxKind.ElementAccessExpression */:
114
- case 227 /* SyntaxKind.BinaryExpression */:
115
- case 209 /* SyntaxKind.BindingElement */:
116
- case 177 /* SyntaxKind.Constructor */:
110
+ case 262 /* SyntaxKind.VariableDeclaration */:
111
+ case 174 /* SyntaxKind.PropertyDeclaration */:
112
+ case 173 /* SyntaxKind.PropertySignature */:
113
+ case 213 /* SyntaxKind.PropertyAccessExpression */:
114
+ case 214 /* SyntaxKind.ElementAccessExpression */:
115
+ case 228 /* SyntaxKind.BinaryExpression */:
116
+ case 210 /* SyntaxKind.BindingElement */:
117
+ case 178 /* SyntaxKind.Constructor */:
117
118
  return simple(node, variableTypeMessage(node, result));
118
- case 179 /* SyntaxKind.SetAccessor */:
119
- case 178 /* SyntaxKind.GetAccessor */: {
119
+ case 180 /* SyntaxKind.SetAccessor */:
120
+ case 179 /* SyntaxKind.GetAccessor */: {
120
121
  const name = getNameOfDeclaration(node);
121
122
  const message = accessorTypeMessage(node, result);
122
123
  return name === undefined ? undefined : new SymbolAccessibilityDiagnostic(name, message, name);
123
124
  }
124
- case 181 /* SyntaxKind.ConstructSignature */:
125
- case 180 /* SyntaxKind.CallSignature */:
126
- case 175 /* SyntaxKind.MethodDeclaration */:
127
- case 174 /* SyntaxKind.MethodSignature */:
128
- case 263 /* SyntaxKind.FunctionDeclaration */:
129
- case 182 /* SyntaxKind.IndexSignature */: {
125
+ case 182 /* SyntaxKind.ConstructSignature */:
126
+ case 181 /* SyntaxKind.CallSignature */:
127
+ case 176 /* SyntaxKind.MethodDeclaration */:
128
+ case 175 /* SyntaxKind.MethodSignature */:
129
+ case 264 /* SyntaxKind.FunctionDeclaration */:
130
+ case 183 /* SyntaxKind.IndexSignature */: {
130
131
  const name = getNameOfDeclaration(node);
131
132
  return new SymbolAccessibilityDiagnostic(name ?? node, returnTypeMessage(node, result), undefined);
132
133
  }
133
- case 170 /* SyntaxKind.Parameter */:
134
+ case 171 /* SyntaxKind.Parameter */:
134
135
  if (isParameterPropertyDeclaration(node, node.parent) &&
135
136
  hasSyntacticModifier(node.parent, 2 /* ModifierFlags.Private */))
136
137
  return simple(node, variableTypeMessage(node, result));
137
138
  return simple(node, parameterTypeMessage(node, result));
138
- case 169 /* SyntaxKind.TypeParameter */:
139
+ case 170 /* SyntaxKind.TypeParameter */:
139
140
  return simple(node, typeParameterConstraintMessage(node));
140
- case 234 /* SyntaxKind.ExpressionWithTypeArguments */:
141
+ case 235 /* SyntaxKind.ExpressionWithTypeArguments */:
141
142
  return heritageDiagnostic(node);
142
- case 272 /* SyntaxKind.ImportEqualsDeclaration */:
143
- return simple(node, 1004 /* Diagnostics.Import_declaration_0_is_using_private_name_1 */);
144
- case 266 /* SyntaxKind.TypeAliasDeclaration */:
145
- case 345 /* SyntaxKind.JSTypeAliasDeclaration */: {
143
+ case 273 /* SyntaxKind.ImportEqualsDeclaration */:
144
+ return simple(node, 1011 /* Diagnostics.Import_declaration_0_is_using_private_name_1 */);
145
+ case 267 /* SyntaxKind.TypeAliasDeclaration */:
146
+ case 346 /* SyntaxKind.JSTypeAliasDeclaration */: {
146
147
  const message = result.errorModuleName !== ''
147
- ? 1076 /* Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2 */
148
- : 1073 /* Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1 */;
148
+ ? 1083 /* Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2 */
149
+ : 1080 /* Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1 */;
149
150
  const type = getType(node);
150
151
  return new SymbolAccessibilityDiagnostic(type ?? node, message, getName(node));
151
152
  }
152
- case 214 /* SyntaxKind.CallExpression */: {
153
+ case 215 /* SyntaxKind.CallExpression */: {
153
154
  // `Object.defineProperty(exports, "name", …)` in JavaScript.
154
155
  const name = node instanceof CallExpression ? node.arguments.nodes[1] : node;
155
- return new SymbolAccessibilityDiagnostic(name, byModuleName(result, 1017 /* Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1018 /* Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 */, 1019 /* Diagnostics.Exported_variable_0_has_or_is_using_private_name_1 */), name);
156
+ return new SymbolAccessibilityDiagnostic(name, byModuleName(result, 1024 /* Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1025 /* Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 */, 1026 /* Diagnostics.Exported_variable_0_has_or_is_using_private_name_1 */), name);
156
157
  }
157
158
  }
158
159
  throw new Error('Attempted to set a declaration diagnostic context for unhandled node kind');
@@ -161,16 +162,16 @@ function heritageDiagnostic(node) {
161
162
  const clause = node.parent;
162
163
  const declaration = clause.parent;
163
164
  let message;
164
- if (declaration.kind === 264 /* SyntaxKind.ClassDeclaration */) {
165
+ if (declaration.kind === 265 /* SyntaxKind.ClassDeclaration */) {
165
166
  if (clause instanceof HeritageClause && clause.token === 118 /* SyntaxKind.ImplementsKeyword */)
166
- message = 1013 /* Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 */;
167
+ message = 1020 /* Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 */;
167
168
  else if (getName(declaration) !== undefined)
168
- message = 1014 /* Diagnostics.X_extends_clause_of_exported_class_0_has_or_is_using_private_name_1 */;
169
+ message = 1021 /* Diagnostics.X_extends_clause_of_exported_class_0_has_or_is_using_private_name_1 */;
169
170
  else
170
- message = 1015 /* Diagnostics.X_extends_clause_of_exported_class_has_or_is_using_private_name_0 */;
171
+ message = 1022 /* Diagnostics.X_extends_clause_of_exported_class_has_or_is_using_private_name_0 */;
171
172
  }
172
173
  else
173
- message = 1016 /* Diagnostics.X_extends_clause_of_exported_interface_0_has_or_is_using_private_name_1 */;
174
+ message = 1023 /* Diagnostics.X_extends_clause_of_exported_interface_0_has_or_is_using_private_name_1 */;
174
175
  return new SymbolAccessibilityDiagnostic(node, message, getNameOfDeclaration(declaration));
175
176
  }
176
177
  function byModuleName(result, cannotBeNamed, privateModule, nonModule) {
@@ -183,208 +184,210 @@ function byModuleNameOnly(result, privateModule, nonModule) {
183
184
  }
184
185
  function accessorNameMessage(node, result) {
185
186
  if (isStatic(node))
186
- return byModuleName(result, 1020 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1021 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1022 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1 */);
187
- if (node.parent.kind === 264 /* SyntaxKind.ClassDeclaration */)
188
- return byModuleName(result, 1023 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1024 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1025 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1 */);
189
- return byModuleNameOnly(result, 1026 /* Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1027 /* Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1 */);
187
+ return byModuleName(result, 1027 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1028 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1029 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1 */);
188
+ if (node.parent.kind === 265 /* SyntaxKind.ClassDeclaration */)
189
+ return byModuleName(result, 1030 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1031 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1032 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1 */);
190
+ return byModuleNameOnly(result, 1033 /* Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1034 /* Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1 */);
190
191
  }
191
192
  function methodNameMessage(node, result) {
192
193
  if (isStatic(node))
193
- return byModuleName(result, 1081 /* Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1082 /* Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1083 /* Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1 */);
194
- if (node.parent.kind === 264 /* SyntaxKind.ClassDeclaration */)
195
- return byModuleName(result, 1084 /* Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1085 /* Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1086 /* Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1 */);
196
- return byModuleNameOnly(result, 1087 /* Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1088 /* Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1 */);
194
+ return byModuleName(result, 1088 /* Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1089 /* Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1090 /* Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1 */);
195
+ if (node.parent.kind === 265 /* SyntaxKind.ClassDeclaration */)
196
+ return byModuleName(result, 1091 /* Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1092 /* Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1093 /* Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1 */);
197
+ return byModuleNameOnly(result, 1094 /* Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1095 /* Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1 */);
197
198
  }
198
199
  function variableTypeMessage(node, result) {
199
- if (node.kind === 261 /* SyntaxKind.VariableDeclaration */ || node.kind === 209 /* SyntaxKind.BindingElement */)
200
- return byModuleName(result, 1017 /* Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1018 /* Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 */, 1019 /* Diagnostics.Exported_variable_0_has_or_is_using_private_name_1 */);
200
+ if (node.kind === 262 /* SyntaxKind.VariableDeclaration */ || node.kind === 210 /* SyntaxKind.BindingElement */)
201
+ return byModuleName(result, 1024 /* Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1025 /* Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 */, 1026 /* Diagnostics.Exported_variable_0_has_or_is_using_private_name_1 */);
201
202
  // Constructor parameter properties report as parameters, unless the constructor is private.
202
- if (node.kind === 173 /* SyntaxKind.PropertyDeclaration */ ||
203
- node.kind === 212 /* SyntaxKind.PropertyAccessExpression */ ||
204
- node.kind === 213 /* SyntaxKind.ElementAccessExpression */ ||
205
- node.kind === 227 /* SyntaxKind.BinaryExpression */ ||
206
- node.kind === 172 /* SyntaxKind.PropertySignature */ ||
207
- (node.kind === 170 /* SyntaxKind.Parameter */ && hasSyntacticModifier(node.parent, 2 /* ModifierFlags.Private */))) {
203
+ if (node.kind === 174 /* SyntaxKind.PropertyDeclaration */ ||
204
+ node.kind === 213 /* SyntaxKind.PropertyAccessExpression */ ||
205
+ node.kind === 214 /* SyntaxKind.ElementAccessExpression */ ||
206
+ node.kind === 228 /* SyntaxKind.BinaryExpression */ ||
207
+ node.kind === 173 /* SyntaxKind.PropertySignature */ ||
208
+ (node.kind === 171 /* SyntaxKind.Parameter */ && hasSyntacticModifier(node.parent, 2 /* ModifierFlags.Private */))) {
208
209
  if (isStatic(node))
209
- return byModuleName(result, 1020 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1021 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1022 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1 */);
210
- if (node.parent.kind === 264 /* SyntaxKind.ClassDeclaration */ || node.kind === 170 /* SyntaxKind.Parameter */)
211
- return byModuleName(result, 1023 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1024 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1025 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1 */);
212
- return byModuleNameOnly(result, 1026 /* Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1027 /* Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1 */);
210
+ return byModuleName(result, 1027 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1028 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1029 /* Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1 */);
211
+ if (node.parent.kind === 265 /* SyntaxKind.ClassDeclaration */ || node.kind === 171 /* SyntaxKind.Parameter */)
212
+ return byModuleName(result, 1030 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1031 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1032 /* Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1 */);
213
+ return byModuleNameOnly(result, 1033 /* Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1034 /* Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1 */);
213
214
  }
214
215
  return undefined;
215
216
  }
216
217
  function accessorTypeMessage(node, result) {
217
- if (node.kind === 179 /* SyntaxKind.SetAccessor */) {
218
+ if (node.kind === 180 /* SyntaxKind.SetAccessor */) {
218
219
  // A setter's parameter type is written by the user, so it can always be named.
219
220
  if (isStatic(node))
220
- return byModuleNameOnly(result, 1028 /* Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1029 /* Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1 */);
221
- return byModuleNameOnly(result, 1030 /* Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1031 /* Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1 */);
221
+ return byModuleNameOnly(result, 1035 /* Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1036 /* Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1 */);
222
+ return byModuleNameOnly(result, 1037 /* Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1038 /* Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1 */);
222
223
  }
223
224
  if (isStatic(node))
224
- return byModuleName(result, 1032 /* Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1033 /* Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1034 /* Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1 */);
225
- return byModuleName(result, 1035 /* Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1036 /* Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1037 /* Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1 */);
225
+ return byModuleName(result, 1039 /* Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1040 /* Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1041 /* Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1 */);
226
+ return byModuleName(result, 1042 /* Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1043 /* Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1044 /* Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1 */);
226
227
  }
227
228
  function returnTypeMessage(node, result) {
228
229
  switch (node.kind) {
229
- case 181 /* SyntaxKind.ConstructSignature */:
230
- return byModuleNameOnly(result, 1038 /* Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 */, 1039 /* Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0 */);
231
- case 180 /* SyntaxKind.CallSignature */:
232
- return byModuleNameOnly(result, 1040 /* Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 */, 1041 /* Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0 */);
233
- case 182 /* SyntaxKind.IndexSignature */:
234
- return byModuleNameOnly(result, 1042 /* Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 */, 1043 /* Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0 */);
235
- case 175 /* SyntaxKind.MethodDeclaration */:
236
- case 174 /* SyntaxKind.MethodSignature */:
230
+ case 182 /* SyntaxKind.ConstructSignature */:
231
+ return byModuleNameOnly(result, 1045 /* Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 */, 1046 /* Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0 */);
232
+ case 181 /* SyntaxKind.CallSignature */:
233
+ return byModuleNameOnly(result, 1047 /* Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 */, 1048 /* Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0 */);
234
+ case 183 /* SyntaxKind.IndexSignature */:
235
+ return byModuleNameOnly(result, 1049 /* Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 */, 1050 /* Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0 */);
236
+ case 176 /* SyntaxKind.MethodDeclaration */:
237
+ case 175 /* SyntaxKind.MethodSignature */:
237
238
  if (isStatic(node))
238
- return byModuleName(result, 1044 /* Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named */, 1045 /* Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 */, 1046 /* Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0 */);
239
- if (node.parent.kind === 264 /* SyntaxKind.ClassDeclaration */)
240
- return byModuleName(result, 1047 /* Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named */, 1048 /* Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 */, 1049 /* Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0 */);
241
- return byModuleNameOnly(result, 1050 /* Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 */, 1051 /* Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0 */);
242
- case 263 /* SyntaxKind.FunctionDeclaration */:
243
- return byModuleName(result, 1052 /* Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named */, 1053 /* Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 */, 1054 /* Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0 */);
239
+ return byModuleName(result, 1051 /* Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named */, 1052 /* Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 */, 1053 /* Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0 */);
240
+ if (node.parent.kind === 265 /* SyntaxKind.ClassDeclaration */)
241
+ return byModuleName(result, 1054 /* Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named */, 1055 /* Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 */, 1056 /* Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0 */);
242
+ return byModuleNameOnly(result, 1057 /* Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 */, 1058 /* Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0 */);
243
+ case 264 /* SyntaxKind.FunctionDeclaration */:
244
+ return byModuleName(result, 1059 /* Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named */, 1060 /* Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 */, 1061 /* Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0 */);
244
245
  }
245
246
  throw new Error('This is unknown kind for signature');
246
247
  }
247
248
  function parameterTypeMessage(node, result) {
248
249
  const parent = node.parent;
249
250
  switch (parent.kind) {
250
- case 177 /* SyntaxKind.Constructor */:
251
- return byModuleName(result, 1055 /* Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1056 /* Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1057 /* Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1 */);
252
- case 181 /* SyntaxKind.ConstructSignature */:
253
- case 186 /* SyntaxKind.ConstructorType */:
254
- return byModuleNameOnly(result, 1058 /* Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1059 /* Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1 */);
255
- case 180 /* SyntaxKind.CallSignature */:
256
- return byModuleNameOnly(result, 1060 /* Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1061 /* Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1 */);
257
- case 182 /* SyntaxKind.IndexSignature */:
258
- return byModuleNameOnly(result, 1078 /* Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1079 /* Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1 */);
259
- case 175 /* SyntaxKind.MethodDeclaration */:
260
- case 174 /* SyntaxKind.MethodSignature */:
251
+ case 178 /* SyntaxKind.Constructor */:
252
+ return byModuleName(result, 1062 /* Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1063 /* Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1064 /* Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1 */);
253
+ case 182 /* SyntaxKind.ConstructSignature */:
254
+ case 187 /* SyntaxKind.ConstructorType */:
255
+ return byModuleNameOnly(result, 1065 /* Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1066 /* Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1 */);
256
+ case 181 /* SyntaxKind.CallSignature */:
257
+ return byModuleNameOnly(result, 1067 /* Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1068 /* Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1 */);
258
+ case 183 /* SyntaxKind.IndexSignature */:
259
+ return byModuleNameOnly(result, 1085 /* Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1086 /* Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1 */);
260
+ case 176 /* SyntaxKind.MethodDeclaration */:
261
+ case 175 /* SyntaxKind.MethodSignature */:
261
262
  if (isStatic(parent))
262
- return byModuleName(result, 1062 /* Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1063 /* Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1064 /* Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1 */);
263
- if (parent.parent.kind === 264 /* SyntaxKind.ClassDeclaration */)
264
- return byModuleName(result, 1065 /* Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1066 /* Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1067 /* Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1 */);
265
- return byModuleNameOnly(result, 1068 /* Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1069 /* Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1 */);
266
- case 263 /* SyntaxKind.FunctionDeclaration */:
267
- case 185 /* SyntaxKind.FunctionType */:
268
- return byModuleName(result, 1070 /* Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1071 /* Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 */, 1072 /* Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1 */);
269
- case 179 /* SyntaxKind.SetAccessor */:
270
- case 178 /* SyntaxKind.GetAccessor */:
271
- return byModuleName(result, 1094 /* Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1093 /* Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 */, 1092 /* Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1 */);
263
+ return byModuleName(result, 1069 /* Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1070 /* Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1071 /* Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1 */);
264
+ if (parent.parent.kind === 265 /* SyntaxKind.ClassDeclaration */)
265
+ return byModuleName(result, 1072 /* Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1073 /* Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 */, 1074 /* Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1 */);
266
+ return byModuleNameOnly(result, 1075 /* Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 */, 1076 /* Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1 */);
267
+ case 264 /* SyntaxKind.FunctionDeclaration */:
268
+ case 186 /* SyntaxKind.FunctionType */:
269
+ case 221 /* SyntaxKind.ArrowFunction */:
270
+ case 220 /* SyntaxKind.FunctionExpression */:
271
+ return byModuleName(result, 1077 /* Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1078 /* Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 */, 1079 /* Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1 */);
272
+ case 180 /* SyntaxKind.SetAccessor */:
273
+ case 179 /* SyntaxKind.GetAccessor */:
274
+ return byModuleName(result, 1101 /* Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named */, 1100 /* Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 */, 1099 /* Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1 */);
272
275
  }
273
276
  throw new Error('Unknown parent for parameter');
274
277
  }
275
278
  function typeParameterConstraintMessage(node) {
276
279
  const parent = node.parent;
277
280
  switch (parent.kind) {
278
- case 264 /* SyntaxKind.ClassDeclaration */:
279
- return 1005 /* Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1 */;
280
- case 265 /* SyntaxKind.InterfaceDeclaration */:
281
- return 1006 /* Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1 */;
282
- case 201 /* SyntaxKind.MappedType */:
283
- return 1089 /* Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1 */;
284
- case 186 /* SyntaxKind.ConstructorType */:
285
- case 181 /* SyntaxKind.ConstructSignature */:
286
- return 1007 /* Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1 */;
287
- case 180 /* SyntaxKind.CallSignature */:
288
- return 1008 /* Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1 */;
289
- case 175 /* SyntaxKind.MethodDeclaration */:
290
- case 174 /* SyntaxKind.MethodSignature */:
281
+ case 265 /* SyntaxKind.ClassDeclaration */:
282
+ return 1012 /* Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1 */;
283
+ case 266 /* SyntaxKind.InterfaceDeclaration */:
284
+ return 1013 /* Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1 */;
285
+ case 202 /* SyntaxKind.MappedType */:
286
+ return 1096 /* Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1 */;
287
+ case 187 /* SyntaxKind.ConstructorType */:
288
+ case 182 /* SyntaxKind.ConstructSignature */:
289
+ return 1014 /* Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1 */;
290
+ case 181 /* SyntaxKind.CallSignature */:
291
+ return 1015 /* Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1 */;
292
+ case 176 /* SyntaxKind.MethodDeclaration */:
293
+ case 175 /* SyntaxKind.MethodSignature */:
291
294
  if (isStatic(parent))
292
- return 1009 /* Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1 */;
293
- if (parent.parent.kind === 264 /* SyntaxKind.ClassDeclaration */)
294
- return 1010 /* Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1 */;
295
- return 1011 /* Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1 */;
296
- case 185 /* SyntaxKind.FunctionType */:
297
- case 263 /* SyntaxKind.FunctionDeclaration */:
298
- return 1012 /* Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1 */;
299
- case 196 /* SyntaxKind.InferType */:
300
- return 1077 /* Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1 */;
301
- case 266 /* SyntaxKind.TypeAliasDeclaration */:
302
- case 345 /* SyntaxKind.JSTypeAliasDeclaration */:
303
- return 1075 /* Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1 */;
295
+ return 1016 /* Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1 */;
296
+ if (parent.parent.kind === 265 /* SyntaxKind.ClassDeclaration */)
297
+ return 1017 /* Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1 */;
298
+ return 1018 /* Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1 */;
299
+ case 186 /* SyntaxKind.FunctionType */:
300
+ case 264 /* SyntaxKind.FunctionDeclaration */:
301
+ return 1019 /* Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1 */;
302
+ case 197 /* SyntaxKind.InferType */:
303
+ return 1084 /* Diagnostics.Extends_clause_for_inferred_type_0_has_or_is_using_private_name_1 */;
304
+ case 267 /* SyntaxKind.TypeAliasDeclaration */:
305
+ case 346 /* SyntaxKind.JSTypeAliasDeclaration */:
306
+ return 1082 /* Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1 */;
304
307
  }
305
308
  throw new Error('This is unknown parent for type parameter');
306
309
  }
307
310
  // isolatedDeclarations
308
311
  function relatedSuggestion(kind) {
309
312
  switch (kind) {
310
- case 220 /* SyntaxKind.ArrowFunction */:
311
- case 219 /* SyntaxKind.FunctionExpression */:
312
- return 1794 /* Diagnostics.Add_a_return_type_to_the_function_expression */;
313
- case 175 /* SyntaxKind.MethodDeclaration */:
314
- return 1798 /* Diagnostics.Add_a_return_type_to_the_method */;
315
- case 178 /* SyntaxKind.GetAccessor */:
316
- return 1796 /* Diagnostics.Add_a_return_type_to_the_get_accessor_declaration */;
317
- case 179 /* SyntaxKind.SetAccessor */:
318
- return 1797 /* Diagnostics.Add_a_type_to_parameter_of_the_set_accessor_declaration */;
319
- case 263 /* SyntaxKind.FunctionDeclaration */:
320
- case 181 /* SyntaxKind.ConstructSignature */:
321
- return 1795 /* Diagnostics.Add_a_return_type_to_the_function_declaration */;
322
- case 170 /* SyntaxKind.Parameter */:
323
- return 1792 /* Diagnostics.Add_a_type_annotation_to_the_parameter_0 */;
324
- case 261 /* SyntaxKind.VariableDeclaration */:
325
- return 1791 /* Diagnostics.Add_a_type_annotation_to_the_variable_0 */;
326
- case 173 /* SyntaxKind.PropertyDeclaration */:
327
- case 172 /* SyntaxKind.PropertySignature */:
328
- return 1793 /* Diagnostics.Add_a_type_annotation_to_the_property_0 */;
329
- case 278 /* SyntaxKind.ExportAssignment */:
330
- return 1800 /* Diagnostics.Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it */;
313
+ case 221 /* SyntaxKind.ArrowFunction */:
314
+ case 220 /* SyntaxKind.FunctionExpression */:
315
+ return 1814 /* Diagnostics.Add_a_return_type_to_the_function_expression */;
316
+ case 176 /* SyntaxKind.MethodDeclaration */:
317
+ return 1818 /* Diagnostics.Add_a_return_type_to_the_method */;
318
+ case 179 /* SyntaxKind.GetAccessor */:
319
+ return 1816 /* Diagnostics.Add_a_return_type_to_the_get_accessor_declaration */;
320
+ case 180 /* SyntaxKind.SetAccessor */:
321
+ return 1817 /* Diagnostics.Add_a_type_to_parameter_of_the_set_accessor_declaration */;
322
+ case 264 /* SyntaxKind.FunctionDeclaration */:
323
+ case 182 /* SyntaxKind.ConstructSignature */:
324
+ return 1815 /* Diagnostics.Add_a_return_type_to_the_function_declaration */;
325
+ case 171 /* SyntaxKind.Parameter */:
326
+ return 1812 /* Diagnostics.Add_a_type_annotation_to_the_parameter_0 */;
327
+ case 262 /* SyntaxKind.VariableDeclaration */:
328
+ return 1811 /* Diagnostics.Add_a_type_annotation_to_the_variable_0 */;
329
+ case 174 /* SyntaxKind.PropertyDeclaration */:
330
+ case 173 /* SyntaxKind.PropertySignature */:
331
+ return 1813 /* Diagnostics.Add_a_type_annotation_to_the_property_0 */;
332
+ case 279 /* SyntaxKind.ExportAssignment */:
333
+ return 1820 /* Diagnostics.Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it */;
331
334
  }
332
335
  return undefined;
333
336
  }
334
337
  function errorByDeclarationKind(kind) {
335
338
  switch (kind) {
336
- case 219 /* SyntaxKind.FunctionExpression */:
337
- case 263 /* SyntaxKind.FunctionDeclaration */:
338
- case 220 /* SyntaxKind.ArrowFunction */:
339
- return 1772 /* Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations */;
340
- case 175 /* SyntaxKind.MethodDeclaration */:
341
- case 181 /* SyntaxKind.ConstructSignature */:
342
- return 1773 /* Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations */;
343
- case 178 /* SyntaxKind.GetAccessor */:
344
- case 179 /* SyntaxKind.SetAccessor */:
345
- return 1774 /* Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations */;
346
- case 170 /* SyntaxKind.Parameter */:
347
- return 1776 /* Diagnostics.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations */;
348
- case 261 /* SyntaxKind.VariableDeclaration */:
349
- return 1775 /* Diagnostics.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations */;
350
- case 173 /* SyntaxKind.PropertyDeclaration */:
351
- case 172 /* SyntaxKind.PropertySignature */:
352
- return 1777 /* Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations */;
353
- case 168 /* SyntaxKind.ComputedPropertyName */:
354
- return 1802 /* Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations */;
355
- case 305 /* SyntaxKind.SpreadAssignment */:
356
- return 1780 /* Diagnostics.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations */;
357
- case 304 /* SyntaxKind.ShorthandPropertyAssignment */:
358
- return 1781 /* Diagnostics.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations */;
359
- case 210 /* SyntaxKind.ArrayLiteralExpression */:
360
- return 1782 /* Diagnostics.Only_const_arrays_can_be_inferred_with_isolatedDeclarations */;
361
- case 278 /* SyntaxKind.ExportAssignment */:
362
- return 1801 /* Diagnostics.Default_exports_can_t_be_inferred_with_isolatedDeclarations */;
363
- case 231 /* SyntaxKind.SpreadElement */:
364
- return 1783 /* Diagnostics.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations */;
339
+ case 220 /* SyntaxKind.FunctionExpression */:
340
+ case 264 /* SyntaxKind.FunctionDeclaration */:
341
+ case 221 /* SyntaxKind.ArrowFunction */:
342
+ return 1792 /* Diagnostics.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations */;
343
+ case 176 /* SyntaxKind.MethodDeclaration */:
344
+ case 182 /* SyntaxKind.ConstructSignature */:
345
+ return 1793 /* Diagnostics.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations */;
346
+ case 179 /* SyntaxKind.GetAccessor */:
347
+ case 180 /* SyntaxKind.SetAccessor */:
348
+ return 1794 /* Diagnostics.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations */;
349
+ case 171 /* SyntaxKind.Parameter */:
350
+ return 1796 /* Diagnostics.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations */;
351
+ case 262 /* SyntaxKind.VariableDeclaration */:
352
+ return 1795 /* Diagnostics.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations */;
353
+ case 174 /* SyntaxKind.PropertyDeclaration */:
354
+ case 173 /* SyntaxKind.PropertySignature */:
355
+ return 1797 /* Diagnostics.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations */;
356
+ case 169 /* SyntaxKind.ComputedPropertyName */:
357
+ return 1822 /* Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations */;
358
+ case 306 /* SyntaxKind.SpreadAssignment */:
359
+ return 1800 /* Diagnostics.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations */;
360
+ case 305 /* SyntaxKind.ShorthandPropertyAssignment */:
361
+ return 1801 /* Diagnostics.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations */;
362
+ case 211 /* SyntaxKind.ArrayLiteralExpression */:
363
+ return 1802 /* Diagnostics.Only_const_arrays_can_be_inferred_with_isolatedDeclarations */;
364
+ case 279 /* SyntaxKind.ExportAssignment */:
365
+ return 1821 /* Diagnostics.Default_exports_can_t_be_inferred_with_isolatedDeclarations */;
366
+ case 232 /* SyntaxKind.SpreadElement */:
367
+ return 1803 /* Diagnostics.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations */;
365
368
  }
366
- return 1778 /* Diagnostics.Expression_type_can_t_be_inferred_with_isolatedDeclarations */;
369
+ return 1798 /* Diagnostics.Expression_type_can_t_be_inferred_with_isolatedDeclarations */;
367
370
  }
368
371
  function related(node, kind, name) {
369
372
  const message = relatedSuggestion(kind);
370
373
  return message === undefined ? undefined : createDiagnosticForNode(node, message, [name]);
371
374
  }
372
375
  function isDeclarationEnoughForErrors(node) {
373
- return (node.kind === 278 /* SyntaxKind.ExportAssignment */ ||
376
+ return (node.kind === 279 /* SyntaxKind.ExportAssignment */ ||
374
377
  isStatement(node) ||
375
- node.kind === 261 /* SyntaxKind.VariableDeclaration */ ||
376
- node.kind === 173 /* SyntaxKind.PropertyDeclaration */ ||
377
- node.kind === 170 /* SyntaxKind.Parameter */);
378
+ node.kind === 262 /* SyntaxKind.VariableDeclaration */ ||
379
+ node.kind === 174 /* SyntaxKind.PropertyDeclaration */ ||
380
+ node.kind === 171 /* SyntaxKind.Parameter */);
378
381
  }
379
382
  function findNearestDeclaration(node) {
380
383
  let result = node;
381
384
  while (result !== undefined && !isDeclarationEnoughForErrors(result))
382
385
  result = result.parent;
383
- if (result === undefined || result.kind === 278 /* SyntaxKind.ExportAssignment */)
386
+ if (result === undefined || result.kind === 279 /* SyntaxKind.ExportAssignment */)
384
387
  return result;
385
- if (result.kind === 254 /* SyntaxKind.ReturnStatement */) {
388
+ if (result.kind === 255 /* SyntaxKind.ReturnStatement */) {
386
389
  let fn = result;
387
- while (fn !== undefined && !(isFunctionLikeDeclarationKind(fn.kind) && fn.kind !== 177 /* SyntaxKind.Constructor */))
390
+ while (fn !== undefined && !(isFunctionLikeDeclarationKind(fn.kind) && fn.kind !== 178 /* SyntaxKind.Constructor */))
388
391
  fn = fn.parent;
389
392
  return fn;
390
393
  }
@@ -393,7 +396,7 @@ function findNearestDeclaration(node) {
393
396
  return result;
394
397
  }
395
398
  function declarationNameText(declaration) {
396
- if (declaration.kind === 278 /* SyntaxKind.ExportAssignment */)
399
+ if (declaration.kind === 279 /* SyntaxKind.ExportAssignment */)
397
400
  return '';
398
401
  const name = getName(declaration);
399
402
  return name === undefined ? '' : textOfNode(name);
@@ -406,10 +409,10 @@ function addParentDeclarationRelatedInfo(node, diagnostic) {
406
409
  }
407
410
  function isOuterExpressionForErrors(node) {
408
411
  switch (node.kind) {
409
- case 218 /* SyntaxKind.ParenthesizedExpression */:
410
- case 235 /* SyntaxKind.AsExpression */:
411
- case 217 /* SyntaxKind.TypeAssertionExpression */:
412
- case 239 /* SyntaxKind.SatisfiesExpression */:
412
+ case 219 /* SyntaxKind.ParenthesizedExpression */:
413
+ case 236 /* SyntaxKind.AsExpression */:
414
+ case 218 /* SyntaxKind.TypeAssertionExpression */:
415
+ case 240 /* SyntaxKind.SatisfiesExpression */:
413
416
  return true;
414
417
  }
415
418
  return false;
@@ -417,12 +420,12 @@ function isOuterExpressionForErrors(node) {
417
420
  function expressionError(node, message) {
418
421
  const declaration = findNearestDeclaration(node);
419
422
  if (declaration === undefined)
420
- return createDiagnosticForNode(node, message ?? 1778 /* Diagnostics.Expression_type_can_t_be_inferred_with_isolatedDeclarations */, []);
423
+ return createDiagnosticForNode(node, message ?? 1798 /* Diagnostics.Expression_type_can_t_be_inferred_with_isolatedDeclarations */, []);
421
424
  const name = declarationNameText(declaration);
422
425
  // The nearest ancestor that isn't a parenthesis or assertion, unless a statement comes first.
423
426
  let parent = node.parent;
424
427
  while (parent !== undefined) {
425
- if (parent.kind === 278 /* SyntaxKind.ExportAssignment */)
428
+ if (parent.kind === 279 /* SyntaxKind.ExportAssignment */)
426
429
  break;
427
430
  if (isStatement(parent)) {
428
431
  parent = undefined;
@@ -436,9 +439,9 @@ function expressionError(node, message) {
436
439
  const diagnostic = createDiagnosticForNode(node, message ?? errorByDeclarationKind(declaration.kind), []);
437
440
  return diagnostic.addRelatedInfo(related(declaration, declaration.kind, name));
438
441
  }
439
- const diagnostic = createDiagnosticForNode(node, message ?? 1778 /* Diagnostics.Expression_type_can_t_be_inferred_with_isolatedDeclarations */, []);
442
+ const diagnostic = createDiagnosticForNode(node, message ?? 1798 /* Diagnostics.Expression_type_can_t_be_inferred_with_isolatedDeclarations */, []);
440
443
  diagnostic.addRelatedInfo(related(declaration, declaration.kind, name));
441
- return diagnostic.addRelatedInfo(createDiagnosticForNode(node, 1799 /* Diagnostics.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit */, []));
444
+ return diagnostic.addRelatedInfo(createDiagnosticForNode(node, 1819 /* Diagnostics.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit */, []));
442
445
  }
443
446
  function accessorTypeError(node) {
444
447
  const accessors = getAllAccessorDeclarations(node);
@@ -448,63 +451,63 @@ function accessorTypeError(node) {
448
451
  : node;
449
452
  const diagnostic = createDiagnosticForNode(target, errorByDeclarationKind(node.kind), []);
450
453
  if (accessors.setAccessor !== undefined)
451
- diagnostic.addRelatedInfo(related(accessors.setAccessor, 179 /* SyntaxKind.SetAccessor */, ''));
454
+ diagnostic.addRelatedInfo(related(accessors.setAccessor, 180 /* SyntaxKind.SetAccessor */, ''));
452
455
  if (accessors.getAccessor !== undefined)
453
- diagnostic.addRelatedInfo(related(accessors.getAccessor, 178 /* SyntaxKind.GetAccessor */, ''));
456
+ diagnostic.addRelatedInfo(related(accessors.getAccessor, 179 /* SyntaxKind.GetAccessor */, ''));
454
457
  return diagnostic;
455
458
  }
456
459
  /** The isolatedDeclarations error for a type that needs inference at `node`. */
457
460
  export function createIsolatedDeclarationError(node, requiresAddingUndefined) {
458
461
  for (let current = node; current !== undefined; current = current.parent)
459
- if (current.kind === 299 /* SyntaxKind.HeritageClause */)
460
- return createDiagnosticForNode(node, 1786 /* Diagnostics.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations */, []);
461
- if (isTypeNodeKind(node.kind) || node.kind === 187 /* SyntaxKind.TypeQuery */ || isEntityNameExpression(node, false))
462
- return addParentDeclarationRelatedInfo(node, createDiagnosticForNode(node, 1803 /* Diagnostics.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations */, [textOfNode(node)]));
462
+ if (current.kind === 300 /* SyntaxKind.HeritageClause */)
463
+ return createDiagnosticForNode(node, 1806 /* Diagnostics.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations */, []);
464
+ if (isPartOfTypeNode(node) || node.kind === 188 /* SyntaxKind.TypeQuery */ || isEntityNameExpression(node, false))
465
+ return addParentDeclarationRelatedInfo(node, createDiagnosticForNode(node, 1823 /* Diagnostics.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations */, [textOfNode(node)]));
463
466
  switch (node.kind) {
464
- case 167 /* SyntaxKind.QualifiedName */:
465
- return addParentDeclarationRelatedInfo(node, createDiagnosticForNode(node, 1803 /* Diagnostics.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations */, [textOfNode(node)]));
466
- case 178 /* SyntaxKind.GetAccessor */:
467
- case 179 /* SyntaxKind.SetAccessor */:
467
+ case 168 /* SyntaxKind.QualifiedName */:
468
+ return addParentDeclarationRelatedInfo(node, createDiagnosticForNode(node, 1823 /* Diagnostics.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations */, [textOfNode(node)]));
469
+ case 179 /* SyntaxKind.GetAccessor */:
470
+ case 180 /* SyntaxKind.SetAccessor */:
468
471
  return accessorTypeError(node);
469
- case 168 /* SyntaxKind.ComputedPropertyName */:
470
- case 304 /* SyntaxKind.ShorthandPropertyAssignment */:
471
- case 305 /* SyntaxKind.SpreadAssignment */:
472
- case 210 /* SyntaxKind.ArrayLiteralExpression */:
473
- case 231 /* SyntaxKind.SpreadElement */:
472
+ case 169 /* SyntaxKind.ComputedPropertyName */:
473
+ case 305 /* SyntaxKind.ShorthandPropertyAssignment */:
474
+ case 306 /* SyntaxKind.SpreadAssignment */:
475
+ case 211 /* SyntaxKind.ArrayLiteralExpression */:
476
+ case 232 /* SyntaxKind.SpreadElement */:
474
477
  return addParentDeclarationRelatedInfo(node, createDiagnosticForNode(node, errorByDeclarationKind(node.kind), []));
475
- case 175 /* SyntaxKind.MethodDeclaration */:
476
- case 181 /* SyntaxKind.ConstructSignature */:
477
- case 219 /* SyntaxKind.FunctionExpression */:
478
- case 220 /* SyntaxKind.ArrowFunction */:
479
- case 263 /* SyntaxKind.FunctionDeclaration */: {
478
+ case 176 /* SyntaxKind.MethodDeclaration */:
479
+ case 182 /* SyntaxKind.ConstructSignature */:
480
+ case 220 /* SyntaxKind.FunctionExpression */:
481
+ case 221 /* SyntaxKind.ArrowFunction */:
482
+ case 264 /* SyntaxKind.FunctionDeclaration */: {
480
483
  const diagnostic = addParentDeclarationRelatedInfo(node, createDiagnosticForNode(node, errorByDeclarationKind(node.kind), []));
481
484
  return diagnostic.addRelatedInfo(related(node, node.kind, ''));
482
485
  }
483
- case 209 /* SyntaxKind.BindingElement */:
484
- return createDiagnosticForNode(node, 1784 /* Diagnostics.Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations */, []);
485
- case 173 /* SyntaxKind.PropertyDeclaration */:
486
- case 261 /* SyntaxKind.VariableDeclaration */: {
486
+ case 210 /* SyntaxKind.BindingElement */:
487
+ return createDiagnosticForNode(node, 1804 /* Diagnostics.Binding_elements_with_initializers_can_t_be_exported_directly_with_isolatedDeclarations */, []);
488
+ case 174 /* SyntaxKind.PropertyDeclaration */:
489
+ case 262 /* SyntaxKind.VariableDeclaration */: {
487
490
  const diagnostic = createDiagnosticForNode(node, errorByDeclarationKind(node.kind), []);
488
491
  const name = getName(node);
489
492
  return diagnostic.addRelatedInfo(related(node, node.kind, name === undefined ? '' : textOfNode(name)));
490
493
  }
491
- case 170 /* SyntaxKind.Parameter */:
494
+ case 171 /* SyntaxKind.Parameter */:
492
495
  return parameterError(node, requiresAddingUndefined);
493
- case 303 /* SyntaxKind.PropertyAssignment */:
496
+ case 304 /* SyntaxKind.PropertyAssignment */:
494
497
  return expressionError(getInitializer(node), undefined);
495
- case 232 /* SyntaxKind.ClassExpression */:
496
- return expressionError(node, 1787 /* Diagnostics.Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations */);
498
+ case 233 /* SyntaxKind.ClassExpression */:
499
+ return expressionError(node, 1807 /* Diagnostics.Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations */);
497
500
  }
498
501
  return expressionError(node, undefined);
499
502
  }
500
503
  function parameterError(node, requiresAddingUndefined) {
501
- if (node.parent !== undefined && node.parent.kind === 179 /* SyntaxKind.SetAccessor */)
504
+ if (node.parent !== undefined && node.parent.kind === 180 /* SyntaxKind.SetAccessor */)
502
505
  return accessorTypeError(node.parent);
503
506
  const initializer = getInitializer(node);
504
507
  if (!requiresAddingUndefined && initializer !== undefined)
505
508
  return expressionError(initializer, undefined);
506
509
  const message = requiresAddingUndefined
507
- ? 1789 /* Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations */
510
+ ? 1809 /* Diagnostics.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations */
508
511
  : errorByDeclarationKind(node.kind);
509
512
  const diagnostic = createDiagnosticForNode(node, message, []);
510
513
  const name = node instanceof ParameterDeclaration ? textOfNode(node.name) : '';
@@ -524,7 +527,7 @@ export class AllAccessorDeclarations {
524
527
  }
525
528
  /** The get and set accessors declaring the same property as `accessor`. */
526
529
  export function getAllAccessorDeclarations(accessor) {
527
- const otherKind = accessor.kind === 179 /* SyntaxKind.SetAccessor */ ? 178 /* SyntaxKind.GetAccessor */ : 179 /* SyntaxKind.SetAccessor */;
530
+ const otherKind = accessor.kind === 180 /* SyntaxKind.SetAccessor */ ? 179 /* SyntaxKind.GetAccessor */ : 180 /* SyntaxKind.SetAccessor */;
528
531
  let other = undefined;
529
532
  const symbol = getSymbol(accessor);
530
533
  if (symbol !== undefined)
@@ -534,6 +537,6 @@ export function getAllAccessorDeclarations(accessor) {
534
537
  break;
535
538
  }
536
539
  const otherFirst = other !== undefined && other.pos < accessor.pos;
537
- const isSet = accessor.kind === 179 /* SyntaxKind.SetAccessor */;
540
+ const isSet = accessor.kind === 180 /* SyntaxKind.SetAccessor */;
538
541
  return new AllAccessorDeclarations(otherFirst ? other : accessor, otherFirst ? accessor : other, isSet ? other : accessor, isSet ? accessor : other);
539
542
  }