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
@@ -71,16 +71,16 @@ class OverloadChecker {
71
71
  const parent = node.parent;
72
72
  const inAmbientContextOrInterface = inAmbientContext ||
73
73
  (parent !== undefined &&
74
- (parent.kind === 265 /* SyntaxKind.InterfaceDeclaration */ || parent.kind === 188 /* SyntaxKind.TypeLiteral */));
74
+ (parent.kind === 266 /* SyntaxKind.InterfaceDeclaration */ || parent.kind === 189 /* SyntaxKind.TypeLiteral */));
75
75
  // Only non-ambient declarations must be consecutive.
76
76
  if (inAmbientContextOrInterface)
77
77
  previousDeclaration = undefined;
78
78
  if (isClassLike(node) && !inAmbientContext)
79
79
  hasNonAmbientClass = true;
80
- if (node.kind !== 263 /* SyntaxKind.FunctionDeclaration */ &&
81
- node.kind !== 175 /* SyntaxKind.MethodDeclaration */ &&
82
- node.kind !== 174 /* SyntaxKind.MethodSignature */ &&
83
- node.kind !== 177 /* SyntaxKind.Constructor */)
80
+ if (node.kind !== 264 /* SyntaxKind.FunctionDeclaration */ &&
81
+ node.kind !== 176 /* SyntaxKind.MethodDeclaration */ &&
82
+ node.kind !== 175 /* SyntaxKind.MethodSignature */ &&
83
+ node.kind !== 178 /* SyntaxKind.Constructor */)
84
84
  continue;
85
85
  functionDeclarations.push(node);
86
86
  const currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck());
@@ -113,10 +113,10 @@ class OverloadChecker {
113
113
  }
114
114
  if (multipleConstructorImplementation)
115
115
  for (const d of functionDeclarations)
116
- c.error(d, 563 /* Diagnostics.Multiple_constructor_implementations_are_not_allowed */);
116
+ c.error(d, 570 /* Diagnostics.Multiple_constructor_implementations_are_not_allowed */);
117
117
  if (duplicateFunctionDeclaration)
118
118
  for (const d of functionDeclarations)
119
- c.error(getNameOfDeclaration(d) ?? d, 564 /* Diagnostics.Duplicate_function_implementation */);
119
+ c.error(getNameOfDeclaration(d) ?? d, 571 /* Diagnostics.Duplicate_function_implementation */);
120
120
  if (hasNonAmbientClass &&
121
121
  !this.isConstructor &&
122
122
  (this.symbol.flags & 16 /* SymbolFlags.Function */) !== 0 &&
@@ -135,7 +135,7 @@ class OverloadChecker {
135
135
  const canonical = isOptionalDeclaration(getCanonicalOverload(declarations, bodyDeclaration));
136
136
  for (const d of declarations)
137
137
  if (isOptionalDeclaration(d) !== canonical)
138
- c.error(getNameOfDeclaration(d), 557 /* Diagnostics.Overload_signatures_must_all_be_optional_or_required */);
138
+ c.error(getNameOfDeclaration(d), 564 /* Diagnostics.Overload_signatures_must_all_be_optional_or_required */);
139
139
  }
140
140
  if (bodyDeclaration === undefined)
141
141
  return;
@@ -143,7 +143,7 @@ class OverloadChecker {
143
143
  for (const signature of getSignaturesOfSymbol(c, this.symbol)) {
144
144
  if (isImplementationCompatibleWithOverload(c, bodySignature, signature))
145
145
  continue;
146
- c.error(signature.declaration, 565 /* Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature */).addRelatedInfo(createDiagnosticForNode(bodyDeclaration, 882 /* Diagnostics.The_implementation_signature_is_declared_here */, []));
146
+ c.error(signature.declaration, 572 /* Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature */).addRelatedInfo(createDiagnosticForNode(bodyDeclaration, 889 /* Diagnostics.The_implementation_signature_is_declared_here */, []));
147
147
  break;
148
148
  }
149
149
  }
@@ -151,19 +151,19 @@ class OverloadChecker {
151
151
  const c = this.c;
152
152
  const classes = [];
153
153
  for (const d of getDeclarations(this.symbol))
154
- if (d.kind === 264 /* SyntaxKind.ClassDeclaration */)
154
+ if (d.kind === 265 /* SyntaxKind.ClassDeclaration */)
155
155
  classes.push(d);
156
156
  for (const d of getDeclarations(this.symbol)) {
157
157
  let message;
158
- if (d.kind === 264 /* SyntaxKind.ClassDeclaration */)
159
- message = 944 /* Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 */;
160
- else if (d.kind === 263 /* SyntaxKind.FunctionDeclaration */)
161
- message = 945 /* Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient */;
158
+ if (d.kind === 265 /* SyntaxKind.ClassDeclaration */)
159
+ message = 951 /* Diagnostics.Class_declaration_cannot_implement_overload_list_for_0 */;
160
+ else if (d.kind === 264 /* SyntaxKind.FunctionDeclaration */)
161
+ message = 952 /* Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient */;
162
162
  else
163
163
  continue;
164
164
  const err = c.error(getNameOfDeclaration(d) ?? d, message, this.symbol.name);
165
165
  for (const r of classes)
166
- err.addRelatedInfo(createDiagnosticForNode(r, 1521 /* Diagnostics.Consider_adding_a_declare_modifier_to_this_class */, []));
166
+ err.addRelatedInfo(createDiagnosticForNode(r, 1532 /* Diagnostics.Consider_adding_a_declare_modifier_to_this_class */, []));
167
167
  }
168
168
  }
169
169
  checkFlagAgreement(overloads, implementation, someOverloadFlags, allOverloadFlags) {
@@ -190,13 +190,13 @@ class OverloadChecker {
190
190
  const deviation = flags ^ canonicalFlags;
191
191
  const deviationInFile = flags ^ canonicalFlagsForFile;
192
192
  if ((deviationInFile & 32 /* ModifierFlags.Export */) !== 0)
193
- c.error(getNameOfDeclaration(o), 554 /* Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported */);
193
+ c.error(getNameOfDeclaration(o), 561 /* Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported */);
194
194
  else if ((deviationInFile & 128 /* ModifierFlags.Ambient */) !== 0)
195
- c.error(getNameOfDeclaration(o), 555 /* Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient */);
195
+ c.error(getNameOfDeclaration(o), 562 /* Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient */);
196
196
  else if ((deviation & (2 /* ModifierFlags.Private */ | 4 /* ModifierFlags.Protected */)) !== 0)
197
- c.error(getNameOfDeclaration(o) ?? o, 556 /* Diagnostics.Overload_signatures_must_all_be_public_private_or_protected */);
197
+ c.error(getNameOfDeclaration(o) ?? o, 563 /* Diagnostics.Overload_signatures_must_all_be_public_private_or_protected */);
198
198
  else if ((deviation & 64 /* ModifierFlags.Abstract */) !== 0)
199
- c.error(getNameOfDeclaration(o), 672 /* Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract */);
199
+ c.error(getNameOfDeclaration(o), 679 /* Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract */);
200
200
  }
201
201
  }
202
202
  }
@@ -212,25 +212,25 @@ class OverloadChecker {
212
212
  const errorNode = subsequentName ?? subsequentNode;
213
213
  if (name !== undefined && subsequentName !== undefined && isSameMemberName(c, name, subsequentName)) {
214
214
  // Mixed static and instance members; other conflicts are reported by the binder.
215
- if ((node.kind === 175 /* SyntaxKind.MethodDeclaration */ || node.kind === 174 /* SyntaxKind.MethodSignature */) &&
215
+ if ((node.kind === 176 /* SyntaxKind.MethodDeclaration */ || node.kind === 175 /* SyntaxKind.MethodSignature */) &&
216
216
  isStatic(node) !== isStatic(subsequentNode))
217
217
  c.error(errorNode, isStatic(node)
218
- ? 558 /* Diagnostics.Function_overload_must_be_static */
219
- : 559 /* Diagnostics.Function_overload_must_not_be_static */);
218
+ ? 565 /* Diagnostics.Function_overload_must_be_static */
219
+ : 566 /* Diagnostics.Function_overload_must_not_be_static */);
220
220
  return;
221
221
  }
222
222
  if (nodeIsPresent(getBody(subsequentNode))) {
223
- c.error(errorNode, 560 /* Diagnostics.Function_implementation_name_must_be_0 */, declarationNameToString(getSourceFileOfNode(node), name));
223
+ c.error(errorNode, 567 /* Diagnostics.Function_implementation_name_must_be_0 */, declarationNameToString(getSourceFileOfNode(node), name));
224
224
  return;
225
225
  }
226
226
  }
227
227
  const errorNode = name ?? node;
228
228
  if (this.isConstructor)
229
- c.error(errorNode, 561 /* Diagnostics.Constructor_implementation_is_missing */);
229
+ c.error(errorNode, 568 /* Diagnostics.Constructor_implementation_is_missing */);
230
230
  else if (hasSyntacticModifier(node, 64 /* ModifierFlags.Abstract */))
231
- c.error(errorNode, 676 /* Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive */);
231
+ c.error(errorNode, 683 /* Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive */);
232
232
  else
233
- c.error(errorNode, 562 /* Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration */);
233
+ c.error(errorNode, 569 /* Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration */);
234
234
  }
235
235
  }
236
236
  /**
@@ -253,7 +253,7 @@ function getNextSibling(node) {
253
253
  function isSameMemberName(c, name, other) {
254
254
  if (name.kind === 80 /* SyntaxKind.PrivateIdentifier */ && other.kind === 80 /* SyntaxKind.PrivateIdentifier */)
255
255
  return getText(name) === getText(other);
256
- if (name.kind === 168 /* SyntaxKind.ComputedPropertyName */ && other.kind === 168 /* SyntaxKind.ComputedPropertyName */)
256
+ if (name.kind === 169 /* SyntaxKind.ComputedPropertyName */ && other.kind === 169 /* SyntaxKind.ComputedPropertyName */)
257
257
  return isTypeIdenticalTo(c, checkComputedPropertyName(c, name), checkComputedPropertyName(c, other));
258
258
  return isPropertyNameLiteral(name) && isPropertyNameLiteral(other) && getText(name) === getText(other);
259
259
  }
@@ -50,13 +50,13 @@ export function checkPropertyAccessExpressionOrQualifiedName(c, node, left, left
50
50
  if (assignmentKind !== 0 /* AssignmentKind.None */ &&
51
51
  lexicallyScopedSymbol !== undefined &&
52
52
  lexicallyScopedSymbol.valueDeclaration !== undefined &&
53
- lexicallyScopedSymbol.valueDeclaration.kind === 175 /* SyntaxKind.MethodDeclaration */)
54
- grammarErrorOnNode(c, right, 935 /* Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable */, name);
53
+ lexicallyScopedSymbol.valueDeclaration.kind === 176 /* SyntaxKind.MethodDeclaration */)
54
+ grammarErrorOnNode(c, right, 942 /* Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable */, name);
55
55
  if (isAnyLike) {
56
56
  if (lexicallyScopedSymbol !== undefined)
57
57
  return isErrorType(c, apparentType) ? c.errorType : apparentType;
58
58
  if (getContainingClassExcludingClassDecorators(right) === undefined) {
59
- grammarErrorOnNode(c, right, 1838 /* Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies */);
59
+ grammarErrorOnNode(c, right, 1858 /* Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies */);
60
60
  return c.anyType;
61
61
  }
62
62
  }
@@ -70,7 +70,7 @@ export function checkPropertyAccessExpressionOrQualifiedName(c, node, left, left
70
70
  else if ((prop.flags & 65536 /* SymbolFlags.SetAccessor */) !== 0 &&
71
71
  (prop.flags & 32768 /* SymbolFlags.GetAccessor */) === 0 &&
72
72
  assignmentKind !== 1 /* AssignmentKind.Definite */)
73
- c.error(node, 937 /* Diagnostics.Private_accessor_was_defined_without_a_getter */);
73
+ c.error(node, 944 /* Diagnostics.Private_accessor_was_defined_without_a_getter */);
74
74
  }
75
75
  else {
76
76
  if (isAnyLike) {
@@ -78,7 +78,7 @@ export function checkPropertyAccessExpressionOrQualifiedName(c, node, left, left
78
78
  markPropertyAliasReferenced(c, node, undefined, leftType);
79
79
  return isErrorType(c, apparentType) ? c.errorType : apparentType;
80
80
  }
81
- prop = getPropertyOfTypeEx(c, apparentType, name, isConstEnumObjectType(apparentType), node.kind === 167 /* SyntaxKind.QualifiedName */);
81
+ prop = getPropertyOfTypeEx(c, apparentType, name, isConstEnumObjectType(apparentType), node.kind === 168 /* SyntaxKind.QualifiedName */);
82
82
  }
83
83
  markPropertyAliasReferenced(c, node, prop, leftType);
84
84
  let propType;
@@ -93,23 +93,27 @@ export function checkPropertyAccessExpressionOrQualifiedName(c, node, left, left
93
93
  if (leftType.symbol === c.globalThisSymbol) {
94
94
  const globalSymbol = c.globalThisSymbol.exports?.get(name);
95
95
  if (globalSymbol !== undefined && (globalSymbol.flags & 418 /* SymbolFlags.BlockScoped */) !== 0)
96
- c.error(right, 516 /* Diagnostics.Property_0_does_not_exist_on_type_1 */, name, typeToString(c, leftType));
96
+ c.error(right, 523 /* Diagnostics.Property_0_does_not_exist_on_type_1 */, name, typeToString(c, leftType));
97
97
  else if (c.noImplicitAny)
98
- c.error(right, 1689 /* Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature */, typeToString(c, leftType));
98
+ c.error(right, 1708 /* Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature */, typeToString(c, leftType));
99
99
  return c.anyType;
100
100
  }
101
- if (name !== '')
102
- reportNonexistentProperty(c, right, isThisTypeParameter(leftType) ? apparentType : leftType);
101
+ if (name !== '') {
102
+ // Deferred, since printing the containing type can resolve it completely, and report circularities
103
+ // while it is being resolved.
104
+ const containingType = isThisTypeParameter(leftType) ? apparentType : leftType;
105
+ c.deferDiagnostic(right, () => reportNonexistentProperty(c, right, containingType));
106
+ }
103
107
  return c.errorType;
104
108
  }
105
109
  if (indexInfo.isReadonly && (assignmentKind !== 0 /* AssignmentKind.None */ || isDeleteTarget(node)))
106
- c.error(node, 698 /* Diagnostics.Index_signature_in_type_0_only_permits_reading */, typeToString(c, apparentType));
110
+ c.error(node, 705 /* Diagnostics.Index_signature_in_type_0_only_permits_reading */, typeToString(c, apparentType));
107
111
  propType = indexInfo.valueType;
108
112
  if (c.noUncheckedIndexedAccess && assignmentKind !== 1 /* AssignmentKind.Definite */)
109
113
  propType = getUnionType(c, [propType, c.missingType]);
110
114
  if (c.compilerOptions.noPropertyAccessFromIndexSignature === true &&
111
- node.kind === 212 /* SyntaxKind.PropertyAccessExpression */)
112
- c.error(right, 1097 /* Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0 */, name);
115
+ node.kind === 213 /* SyntaxKind.PropertyAccessExpression */)
116
+ c.error(right, 1104 /* Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0 */, name);
113
117
  checkDeprecatedIndexSignature(c, right, indexInfo.declaration);
114
118
  }
115
119
  else {
@@ -121,7 +125,7 @@ export function checkPropertyAccessExpressionOrQualifiedName(c, node, left, left
121
125
  c.resolvedSymbols.set(node.id, prop);
122
126
  checkPropertyAccessibility(c, node, left.kind === 107 /* SyntaxKind.SuperKeyword */, assignmentKind !== 0 /* AssignmentKind.None */, apparentType, prop);
123
127
  if (isAssignmentToReadonlyEntity(c, node, prop, assignmentKind)) {
124
- c.error(right, 697 /* Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property */, name);
128
+ c.error(right, 704 /* Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property */, name);
125
129
  return c.errorType;
126
130
  }
127
131
  if (isThisPropertyAccessInConstructor(c, node, prop))
@@ -136,15 +140,15 @@ export function checkPropertyAccessExpressionOrQualifiedName(c, node, left, left
136
140
  }
137
141
  /** Whether `node` is a property of an object destructuring assignment from `this`. */
138
142
  function isThisInitializedObjectBindingExpression(node) {
139
- if (node.kind !== 304 /* SyntaxKind.ShorthandPropertyAssignment */ && node.kind !== 303 /* SyntaxKind.PropertyAssignment */)
143
+ if (node.kind !== 305 /* SyntaxKind.ShorthandPropertyAssignment */ && node.kind !== 304 /* SyntaxKind.PropertyAssignment */)
140
144
  return false;
141
145
  const binary = node.parent.parent;
142
- return (binary.kind === 227 /* SyntaxKind.BinaryExpression */ &&
146
+ return (binary.kind === 228 /* SyntaxKind.BinaryExpression */ &&
143
147
  binary.operatorToken.kind === 63 /* SyntaxKind.EqualsToken */ &&
144
148
  binary.right.kind === 109 /* SyntaxKind.ThisKeyword */);
145
149
  }
146
150
  function isThisInitializedDeclaration(node) {
147
- if (node.kind !== 261 /* SyntaxKind.VariableDeclaration */)
151
+ if (node.kind !== 262 /* SyntaxKind.VariableDeclaration */)
148
152
  return false;
149
153
  const initializer = getInitializer(node);
150
154
  return initializer !== undefined && initializer.kind === 109 /* SyntaxKind.ThisKeyword */;
@@ -183,7 +187,7 @@ function getContainingClassExcludingClassDecorators(node) {
183
187
  for (let current = node.parent; current !== undefined; current = current.parent) {
184
188
  if (isClassLike(current))
185
189
  break;
186
- if (current.kind === 171 /* SyntaxKind.Decorator */) {
190
+ if (current.kind === 172 /* SyntaxKind.Decorator */) {
187
191
  if (current.parent !== undefined && isClassLike(current.parent))
188
192
  return getContainingClass(current.parent);
189
193
  break;
@@ -215,15 +219,15 @@ function checkPrivateIdentifierPropertyAccess(c, leftType, right, lexicallyScope
215
219
  for (let n = getContainingClass(lexicalValueDecl); n !== undefined; n = n.parent) {
216
220
  if (n !== typeClass)
217
221
  continue;
218
- const diagnostic = c.error(right, 1836 /* Diagnostics.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling */, diagName, typeToString(c, leftType));
219
- diagnostic.addRelatedInfo(createDiagnosticForNode(lexicalValueDecl, 1839 /* Diagnostics.The_shadowing_declaration_of_0_is_defined_here */, [
222
+ const diagnostic = c.error(right, 1856 /* Diagnostics.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling */, diagName, typeToString(c, leftType));
223
+ diagnostic.addRelatedInfo(createDiagnosticForNode(lexicalValueDecl, 1859 /* Diagnostics.The_shadowing_declaration_of_0_is_defined_here */, [
220
224
  diagName,
221
225
  ]));
222
- diagnostic.addRelatedInfo(createDiagnosticForNode(typeValueDecl, 1840 /* Diagnostics.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here */, [diagName]));
226
+ diagnostic.addRelatedInfo(createDiagnosticForNode(typeValueDecl, 1860 /* Diagnostics.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here */, [diagName]));
223
227
  return true;
224
228
  }
225
229
  }
226
- c.error(right, 1835 /* Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier */, diagName, symbolToString(c, getSymbol(typeClass)));
230
+ c.error(right, 1855 /* Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier */, diagName, symbolToString(c, getSymbol(typeClass)));
227
231
  return true;
228
232
  }
229
233
  function isThisTypeParameter(t) {
@@ -236,10 +240,10 @@ function isConstEnumObjectType(t) {
236
240
  }
237
241
  export function isMethodAccessForCall(node) {
238
242
  let current = node;
239
- while (current.parent.kind === 218 /* SyntaxKind.ParenthesizedExpression */)
243
+ while (current.parent.kind === 219 /* SyntaxKind.ParenthesizedExpression */)
240
244
  current = current.parent;
241
245
  const parent = current.parent;
242
- return ((parent.kind === 214 /* SyntaxKind.CallExpression */ || parent.kind === 215 /* SyntaxKind.NewExpression */) &&
246
+ return ((parent.kind === 215 /* SyntaxKind.CallExpression */ || parent.kind === 216 /* SyntaxKind.NewExpression */) &&
243
247
  getExpression(parent) === current);
244
248
  }
245
249
  /** Whether `node` is the operand of `delete`, through parentheses. */
@@ -247,9 +251,9 @@ export function isDeleteTarget(node) {
247
251
  if (!isAccessExpression(node))
248
252
  return false;
249
253
  let current = node.parent;
250
- while (current.kind === 218 /* SyntaxKind.ParenthesizedExpression */)
254
+ while (current.kind === 219 /* SyntaxKind.ParenthesizedExpression */)
251
255
  current = current.parent;
252
- return current.kind === 221 /* SyntaxKind.DeleteExpression */;
256
+ return current.kind === 222 /* SyntaxKind.DeleteExpression */;
253
257
  }
254
258
  /** Whether assigning through `expr` targets a readonly entity, outside of initialization. */
255
259
  export function isAssignmentToReadonlyEntity(c, expr, symbol, assignmentKind) {
@@ -267,14 +271,14 @@ export function isAssignmentToReadonlyEntity(c, expr, symbol, assignmentKind) {
267
271
  isAccessExpression(expr) &&
268
272
  getExpression(expr).kind === 109 /* SyntaxKind.ThisKeyword */) {
269
273
  const ctor = getControlFlowContainer(expr);
270
- if (ctor.kind !== 177 /* SyntaxKind.Constructor */)
274
+ if (ctor.kind !== 178 /* SyntaxKind.Constructor */)
271
275
  return true;
272
276
  const declaration = symbol.valueDeclaration;
273
277
  if (declaration !== undefined) {
274
278
  const isLocalPropertyDeclaration = ctor.parent === declaration.parent;
275
279
  const isLocalParameterProperty = ctor === declaration.parent;
276
280
  // A JavaScript `this.x = …` declaration of this class or constructor function.
277
- const isAssignmentDeclaration = declaration.kind === 227 /* SyntaxKind.BinaryExpression */;
281
+ const isAssignmentDeclaration = declaration.kind === 228 /* SyntaxKind.BinaryExpression */;
278
282
  const parentDeclaration = symbol.parent?.valueDeclaration;
279
283
  const isLocalThisPropertyAssignment = isAssignmentDeclaration && (parentDeclaration === ctor.parent || parentDeclaration === ctor);
280
284
  return !isLocalPropertyDeclaration && !isLocalParameterProperty && !isLocalThisPropertyAssignment;
@@ -289,7 +293,7 @@ export function isAssignmentToReadonlyEntity(c, expr, symbol, assignmentKind) {
289
293
  const expressionSymbol = getResolvedSymbol(c, node);
290
294
  if ((expressionSymbol.flags & 2097152 /* SymbolFlags.Alias */) !== 0) {
291
295
  const declaration = getDeclarationOfAliasSymbol(expressionSymbol);
292
- return declaration !== undefined && declaration.kind === 275 /* SyntaxKind.NamespaceImport */;
296
+ return declaration !== undefined && declaration.kind === 276 /* SyntaxKind.NamespaceImport */;
293
297
  }
294
298
  }
295
299
  }
@@ -299,13 +303,13 @@ export function isAssignmentToReadonlyEntity(c, expr, symbol, assignmentKind) {
299
303
  /** Checks that `prop` of `containingType` may be accessed at `node`; reports and returns false otherwise. */
300
304
  export function checkPropertyAccessibility(c, node, isSuper, writing, containingType, prop) {
301
305
  let errorNode;
302
- if (node.kind === 212 /* SyntaxKind.PropertyAccessExpression */)
306
+ if (node.kind === 213 /* SyntaxKind.PropertyAccessExpression */)
303
307
  errorNode = node.name;
304
- else if (node.kind === 167 /* SyntaxKind.QualifiedName */)
308
+ else if (node.kind === 168 /* SyntaxKind.QualifiedName */)
305
309
  errorNode = node.right;
306
- else if (node.kind === 206 /* SyntaxKind.ImportType */)
310
+ else if (node.kind === 207 /* SyntaxKind.ImportType */)
307
311
  errorNode = node;
308
- else if (node.kind === 209 /* SyntaxKind.BindingElement */)
312
+ else if (node.kind === 210 /* SyntaxKind.BindingElement */)
309
313
  errorNode = node.propertyName ?? node.name;
310
314
  else
311
315
  errorNode = getName(node) ?? node;
@@ -329,13 +333,13 @@ function checkPropertyAccessibilityAtLocation(c, location, isSuper, writing, con
329
333
  // Abstract methods can't be reached through `super`.
330
334
  if ((flags & 64 /* ModifierFlags.Abstract */) !== 0) {
331
335
  if (errorNode !== undefined)
332
- c.error(errorNode, 673 /* Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression */, symbolToString(c, prop), typeToString(c, getDeclaringClass(c, prop)));
336
+ c.error(errorNode, 680 /* Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression */, symbolToString(c, prop), typeToString(c, getDeclaringClass(c, prop)));
333
337
  return false;
334
338
  }
335
339
  // Class fields of the parent aren't on the prototype.
336
340
  if ((flags & 256 /* ModifierFlags.Static */) === 0 && hasClassInstancePropertyDeclaration(prop)) {
337
341
  if (errorNode !== undefined)
338
- c.error(errorNode, 975 /* Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super */, symbolToString(c, prop));
342
+ c.error(errorNode, 982 /* Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super */, symbolToString(c, prop));
339
343
  return false;
340
344
  }
341
345
  }
@@ -344,14 +348,14 @@ function checkPropertyAccessibilityAtLocation(c, location, isSuper, writing, con
344
348
  symbolHasNonMethodDeclaration(c, prop) &&
345
349
  (isThisProperty(location) ||
346
350
  isThisInitializedObjectBindingExpression(location) ||
347
- (location.parent.kind === 207 /* SyntaxKind.ObjectBindingPattern */ &&
351
+ (location.parent.kind === 208 /* SyntaxKind.ObjectBindingPattern */ &&
348
352
  isThisInitializedDeclaration(location.parent.parent)))) {
349
353
  const parentSymbol = getParentOfSymbol(c, prop);
350
354
  if (parentSymbol !== undefined &&
351
355
  (parentSymbol.flags & 32 /* SymbolFlags.Class */) !== 0 &&
352
356
  isNodeUsedDuringClassInitialization(location)) {
353
357
  if (errorNode !== undefined)
354
- c.error(errorNode, 847 /* Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor */, symbolToString(c, prop), symbolToString(c, parentSymbol));
358
+ c.error(errorNode, 854 /* Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor */, symbolToString(c, prop), symbolToString(c, parentSymbol));
355
359
  return false;
356
360
  }
357
361
  }
@@ -363,7 +367,7 @@ function checkPropertyAccessibilityAtLocation(c, location, isSuper, writing, con
363
367
  const declaringClassDeclaration = parent !== undefined ? getClassLikeDeclarationOfSymbol(parent) : undefined;
364
368
  if (!isNodeWithinClass(location, declaringClassDeclaration)) {
365
369
  if (errorNode !== undefined)
366
- c.error(errorNode, 518 /* Diagnostics.Property_0_is_private_and_only_accessible_within_class_1 */, symbolToString(c, prop), typeToString(c, getDeclaringClass(c, prop)));
370
+ c.error(errorNode, 525 /* Diagnostics.Property_0_is_private_and_only_accessible_within_class_1 */, symbolToString(c, prop), typeToString(c, getDeclaringClass(c, prop) ?? containingTypeIn));
367
371
  return false;
368
372
  }
369
373
  return true;
@@ -390,7 +394,7 @@ function checkPropertyAccessibilityAtLocation(c, location, isSuper, writing, con
390
394
  enclosingClass = thisClass;
391
395
  if ((flags & 256 /* ModifierFlags.Static */) !== 0 || enclosingClass === undefined) {
392
396
  if (errorNode !== undefined)
393
- c.error(errorNode, 613 /* Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses */, symbolToString(c, prop), typeToString(c, getDeclaringClass(c, prop) ?? containingTypeIn));
397
+ c.error(errorNode, 620 /* Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses */, symbolToString(c, prop), typeToString(c, getDeclaringClass(c, prop) ?? containingTypeIn));
394
398
  return false;
395
399
  }
396
400
  }
@@ -403,7 +407,7 @@ function checkPropertyAccessibilityAtLocation(c, location, isSuper, writing, con
403
407
  : getBaseConstraintOfType(c, containingType);
404
408
  if (containingType === undefined || !hasBaseType(c, containingType, enclosingClass)) {
405
409
  if (containingType !== undefined && errorNode !== undefined)
406
- c.error(errorNode, 614 /* Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2 */, symbolToString(c, prop), typeToString(c, enclosingClass), typeToString(c, containingType));
410
+ c.error(errorNode, 621 /* Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2 */, symbolToString(c, prop), typeToString(c, enclosingClass), typeToString(c, containingType));
407
411
  return false;
408
412
  }
409
413
  return true;
@@ -423,7 +427,7 @@ function isClassInstanceProperty(node) {
423
427
  }
424
428
  return (node.parent !== undefined &&
425
429
  isClassLike(node.parent) &&
426
- node.kind === 173 /* SyntaxKind.PropertyDeclaration */ &&
430
+ node.kind === 174 /* SyntaxKind.PropertyDeclaration */ &&
427
431
  !isStatic(node) &&
428
432
  !hasSyntacticModifier(node, 512 /* ModifierFlags.Accessor */));
429
433
  }
@@ -438,8 +442,8 @@ function isThisProperty(node) {
438
442
  }
439
443
  function isNodeUsedDuringClassInitialization(node) {
440
444
  for (let element = node.parent; element !== undefined; element = element.parent) {
441
- if ((element.kind === 177 /* SyntaxKind.Constructor */ && getBody(element) !== undefined) ||
442
- element.kind === 173 /* SyntaxKind.PropertyDeclaration */)
445
+ if ((element.kind === 178 /* SyntaxKind.Constructor */ && getBody(element) !== undefined) ||
446
+ element.kind === 174 /* SyntaxKind.PropertyDeclaration */)
443
447
  return true;
444
448
  if (isClassLike(element) || isFunctionLike(element))
445
449
  return false;
@@ -537,7 +541,7 @@ export function reportNonexistentProperty(c, propNode, containingType) {
537
541
  for (const subtype of typesOf(containingType)) {
538
542
  if (getPropertyOfType(c, subtype, name) === undefined &&
539
543
  getApplicableIndexInfoForName(c, subtype, name) === undefined) {
540
- chain = createDiagnosticForNode(propNode, 516 /* Diagnostics.Property_0_does_not_exist_on_type_1 */, [
544
+ chain = createDiagnosticForNode(propNode, 523 /* Diagnostics.Property_0_does_not_exist_on_type_1 */, [
541
545
  missingProperty,
542
546
  typeToString(c, subtype),
543
547
  ]);
@@ -547,35 +551,35 @@ export function reportNonexistentProperty(c, propNode, containingType) {
547
551
  }
548
552
  let diagnostic;
549
553
  if (typeHasStaticProperty(c, name, containingType))
550
- diagnostic = createDiagnosticForNode(propNode, 727 /* Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead */, [missingProperty, container, container + '.' + missingProperty]);
554
+ diagnostic = createDiagnosticForNode(propNode, 734 /* Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead */, [missingProperty, container, container + '.' + missingProperty]);
551
555
  else {
552
556
  const promisedType = getPromisedTypeOfPromise(c, containingType);
553
557
  if (promisedType !== undefined && getPropertyOfType(c, promisedType, name) !== undefined) {
554
- diagnostic = createDiagnosticForNode(propNode, 516 /* Diagnostics.Property_0_does_not_exist_on_type_1 */, [
558
+ diagnostic = createDiagnosticForNode(propNode, 523 /* Diagnostics.Property_0_does_not_exist_on_type_1 */, [
555
559
  missingProperty,
556
560
  container,
557
561
  ]);
558
- diagnostic.addRelatedInfo(createDiagnosticForNode(propNode, 905 /* Diagnostics.Did_you_forget_to_use_await */, []));
562
+ diagnostic.addRelatedInfo(createDiagnosticForNode(propNode, 912 /* Diagnostics.Did_you_forget_to_use_await */, []));
559
563
  }
560
564
  else {
561
565
  const libSuggestion = getSuggestedLibForNonExistentProperty(c, missingProperty, containingType);
562
566
  const suggestion = libSuggestion === '' ? getSuggestedSymbolForNonexistentProperty(c, propNode, containingType) : undefined;
563
567
  if (libSuggestion !== '')
564
- diagnostic = createDiagnosticForNode(propNode, 705 /* Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later */, [missingProperty, container, libSuggestion]);
568
+ diagnostic = createDiagnosticForNode(propNode, 712 /* Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later */, [missingProperty, container, libSuggestion]);
565
569
  else if (suggestion !== undefined) {
566
- diagnostic = createDiagnosticForNode(propNode, 706 /* Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2 */, [
570
+ diagnostic = createDiagnosticForNode(propNode, 713 /* Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2 */, [
567
571
  missingProperty,
568
572
  container,
569
573
  suggestion.name,
570
574
  ]);
571
575
  if (suggestion.valueDeclaration !== undefined)
572
- diagnostic.addRelatedInfo(createDiagnosticForNode(suggestion.valueDeclaration, 860 /* Diagnostics.X_0_is_declared_here */, [suggestion.name]));
576
+ diagnostic.addRelatedInfo(createDiagnosticForNode(suggestion.valueDeclaration, 867 /* Diagnostics.X_0_is_declared_here */, [suggestion.name]));
573
577
  }
574
578
  else {
575
579
  chain = elaborateNeverIntersection(c, chain, propNode, containingType);
576
580
  diagnostic = createDiagnosticForNode(propNode, containerSeemsToBeEmptyDomElement(c, containingType)
577
- ? 943 /* Diagnostics.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom */
578
- : 516 /* Diagnostics.Property_0_does_not_exist_on_type_1 */, [missingProperty, container]);
581
+ ? 950 /* Diagnostics.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom */
582
+ : 523 /* Diagnostics.Property_0_does_not_exist_on_type_1 */, [missingProperty, container]);
579
583
  }
580
584
  }
581
585
  }
@@ -591,11 +595,11 @@ export function elaborateNeverIntersection(c, chain, node, t) {
591
595
  if ((t.flags & 268435456 /* TypeFlags.Intersection */) === 0 || (lazyObjectFlags(c, t) & 67108864 /* ObjectFlags.IsNeverIntersection */) === 0)
592
596
  return chain;
593
597
  const props = getPropertiesOfUnionOrIntersectionType(c, t);
594
- let message = 1848 /* Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents */;
598
+ let message = 1868 /* Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents */;
595
599
  let prop = props.find((p) => isDiscriminantWithNeverType(c, p));
596
600
  if (prop === undefined) {
597
601
  message =
598
- 1849 /* Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some */;
602
+ 1869 /* Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some */;
599
603
  prop = props.find(isConflictingPrivateProperty);
600
604
  }
601
605
  if (prop === undefined)
@@ -644,7 +648,7 @@ export function typeHasStaticProperty(c, name, containingType) {
644
648
  export function getSuggestedSymbolForNonexistentProperty(c, name, containingType) {
645
649
  let props = getPropertiesOfType(c, containingType);
646
650
  const parent = name.parent;
647
- if (parent.kind === 212 /* SyntaxKind.PropertyAccessExpression */) {
651
+ if (parent.kind === 213 /* SyntaxKind.PropertyAccessExpression */) {
648
652
  const valid = [];
649
653
  for (const prop of props)
650
654
  if (isValidPropertyAccessForCompletions(c, parent, containingType, prop))
@@ -659,7 +663,7 @@ export function getSuggestionForNonexistentProperty(c, name, containingType) {
659
663
  }
660
664
  /** Whether `property` of `t` may be accessed at `node` without an error, as completions decide. */
661
665
  function isValidPropertyAccessForCompletions(c, node, t, property) {
662
- const isSuper = node.kind === 212 /* SyntaxKind.PropertyAccessExpression */ && getExpression(node).kind === 107 /* SyntaxKind.SuperKeyword */;
666
+ const isSuper = node.kind === 213 /* SyntaxKind.PropertyAccessExpression */ && getExpression(node).kind === 107 /* SyntaxKind.SuperKeyword */;
663
667
  if ((t.flags & 1 /* TypeFlags.Any */) !== 0)
664
668
  return true;
665
669
  // `#private` access in an optional chain is a parse error.
@@ -8,6 +8,7 @@ export declare function getSymbolAtLocation(c: Checker, node: Node): Symbol | un
8
8
  export declare function getSymbolAtLocationWorker(c: Checker, node: Node, ignoreErrors: boolean): Symbol | undefined;
9
9
  /** The type of the expression, type node or declaration at `node`. */
10
10
  export declare function getTypeAtLocation(c: Checker, node: Node): Type;
11
+ export declare function getTypeOfNode(c: Checker, node: Node): Type;
11
12
  /** The narrowed type of `symbol` at `location`, or its declared type when `location` doesn't reference it. */
12
13
  export declare function getTypeOfSymbolAtLocation(c: Checker, symbolIn: Symbol, locationIn: Node | undefined): Type;
13
14
  /** The value symbol of a shorthand property assignment's name. */