@zzzen/pyright-internal 1.2.0-dev.20240728 → 1.2.0-dev.20240811

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 (748) hide show
  1. package/dist/analyzer/analysis.js +2 -2
  2. package/dist/analyzer/analysis.js.map +1 -1
  3. package/dist/analyzer/analyzerFileInfo.js +1 -2
  4. package/dist/analyzer/analyzerFileInfo.js.map +1 -1
  5. package/dist/analyzer/analyzerNodeInfo.js +20 -21
  6. package/dist/analyzer/analyzerNodeInfo.js.map +1 -1
  7. package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -1
  8. package/dist/analyzer/binder.js +8 -5
  9. package/dist/analyzer/binder.js.map +1 -1
  10. package/dist/analyzer/cacheManager.d.ts +0 -1
  11. package/dist/analyzer/cacheManager.js.map +1 -1
  12. package/dist/analyzer/checker.d.ts +4 -1
  13. package/dist/analyzer/checker.js +371 -254
  14. package/dist/analyzer/checker.js.map +1 -1
  15. package/dist/analyzer/circularDependency.js.map +1 -1
  16. package/dist/analyzer/codeFlowEngine.js +10 -10
  17. package/dist/analyzer/codeFlowEngine.js.map +1 -1
  18. package/dist/analyzer/codeFlowTypes.d.ts +17 -17
  19. package/dist/analyzer/codeFlowTypes.js +5 -5
  20. package/dist/analyzer/codeFlowTypes.js.map +1 -1
  21. package/dist/analyzer/codeFlowUtils.js +1 -2
  22. package/dist/analyzer/codeFlowUtils.js.map +1 -1
  23. package/dist/analyzer/commentUtils.js +1 -2
  24. package/dist/analyzer/commentUtils.js.map +1 -1
  25. package/dist/analyzer/constraintSolution.d.ts +22 -0
  26. package/dist/analyzer/constraintSolution.js +77 -0
  27. package/dist/analyzer/constraintSolution.js.map +1 -0
  28. package/dist/analyzer/constraintSolver.d.ts +8 -5
  29. package/dist/analyzer/constraintSolver.js +427 -353
  30. package/dist/analyzer/constraintSolver.js.map +1 -1
  31. package/dist/analyzer/constraintTracker.d.ts +45 -0
  32. package/dist/analyzer/constraintTracker.js +235 -0
  33. package/dist/analyzer/constraintTracker.js.map +1 -0
  34. package/dist/analyzer/constructorTransform.js +23 -23
  35. package/dist/analyzer/constructorTransform.js.map +1 -1
  36. package/dist/analyzer/constructors.d.ts +1 -1
  37. package/dist/analyzer/constructors.js +71 -51
  38. package/dist/analyzer/constructors.js.map +1 -1
  39. package/dist/analyzer/dataClasses.js +72 -58
  40. package/dist/analyzer/dataClasses.js.map +1 -1
  41. package/dist/analyzer/declaration.js +11 -11
  42. package/dist/analyzer/declaration.js.map +1 -1
  43. package/dist/analyzer/declarationUtils.js +8 -9
  44. package/dist/analyzer/declarationUtils.js.map +1 -1
  45. package/dist/analyzer/decorators.d.ts +1 -1
  46. package/dist/analyzer/decorators.js +34 -30
  47. package/dist/analyzer/decorators.js.map +1 -1
  48. package/dist/analyzer/docStringConversion.js +2 -3
  49. package/dist/analyzer/docStringConversion.js.map +1 -1
  50. package/dist/analyzer/docStringUtils.js +2 -3
  51. package/dist/analyzer/docStringUtils.js.map +1 -1
  52. package/dist/analyzer/enums.js +17 -14
  53. package/dist/analyzer/enums.js.map +1 -1
  54. package/dist/analyzer/functionTransform.d.ts +2 -2
  55. package/dist/analyzer/functionTransform.js +2 -3
  56. package/dist/analyzer/functionTransform.js.map +1 -1
  57. package/dist/analyzer/importResolver.d.ts +0 -1
  58. package/dist/analyzer/importResolver.js +5 -5
  59. package/dist/analyzer/importResolver.js.map +1 -1
  60. package/dist/analyzer/importStatementUtils.js +15 -15
  61. package/dist/analyzer/importStatementUtils.js.map +1 -1
  62. package/dist/analyzer/namedTuples.js +2 -3
  63. package/dist/analyzer/namedTuples.js.map +1 -1
  64. package/dist/analyzer/operations.d.ts +1 -2
  65. package/dist/analyzer/operations.js +101 -79
  66. package/dist/analyzer/operations.js.map +1 -1
  67. package/dist/analyzer/packageTypeReport.d.ts +3 -3
  68. package/dist/analyzer/packageTypeReport.js +2 -2
  69. package/dist/analyzer/packageTypeReport.js.map +1 -1
  70. package/dist/analyzer/packageTypeVerifier.js +17 -13
  71. package/dist/analyzer/packageTypeVerifier.js.map +1 -1
  72. package/dist/analyzer/parameterUtils.d.ts +3 -3
  73. package/dist/analyzer/parameterUtils.js +23 -25
  74. package/dist/analyzer/parameterUtils.js.map +1 -1
  75. package/dist/analyzer/parentDirectoryCache.js.map +1 -1
  76. package/dist/analyzer/parseTreeUtils.js +94 -92
  77. package/dist/analyzer/parseTreeUtils.js.map +1 -1
  78. package/dist/analyzer/parseTreeWalker.js +2 -2
  79. package/dist/analyzer/parseTreeWalker.js.map +1 -1
  80. package/dist/analyzer/patternMatching.js +39 -41
  81. package/dist/analyzer/patternMatching.js.map +1 -1
  82. package/dist/analyzer/program.js +5 -1
  83. package/dist/analyzer/program.js.map +1 -1
  84. package/dist/analyzer/properties.d.ts +3 -2
  85. package/dist/analyzer/properties.js +16 -18
  86. package/dist/analyzer/properties.js.map +1 -1
  87. package/dist/analyzer/protocols.d.ts +3 -3
  88. package/dist/analyzer/protocols.js +58 -60
  89. package/dist/analyzer/protocols.js.map +1 -1
  90. package/dist/analyzer/pyTypedUtils.js +2 -3
  91. package/dist/analyzer/pyTypedUtils.js.map +1 -1
  92. package/dist/analyzer/pythonPathUtils.js +6 -6
  93. package/dist/analyzer/pythonPathUtils.js.map +1 -1
  94. package/dist/analyzer/scope.js.map +1 -1
  95. package/dist/analyzer/scopeUtils.js +5 -6
  96. package/dist/analyzer/scopeUtils.js.map +1 -1
  97. package/dist/analyzer/service.d.ts +3 -0
  98. package/dist/analyzer/service.js +173 -103
  99. package/dist/analyzer/service.js.map +1 -1
  100. package/dist/analyzer/serviceUtils.js +5 -5
  101. package/dist/analyzer/serviceUtils.js.map +1 -1
  102. package/dist/analyzer/sourceFile.js.map +1 -1
  103. package/dist/analyzer/sourceFileInfo.js.map +1 -1
  104. package/dist/analyzer/sourceFileInfoUtils.js +4 -5
  105. package/dist/analyzer/sourceFileInfoUtils.js.map +1 -1
  106. package/dist/analyzer/sourceMapper.js +5 -4
  107. package/dist/analyzer/sourceMapper.js.map +1 -1
  108. package/dist/analyzer/sourceMapperUtils.js +1 -2
  109. package/dist/analyzer/sourceMapperUtils.js.map +1 -1
  110. package/dist/analyzer/staticExpressions.js +2 -3
  111. package/dist/analyzer/staticExpressions.js.map +1 -1
  112. package/dist/analyzer/symbol.js.map +1 -1
  113. package/dist/analyzer/symbolNameUtils.js +8 -9
  114. package/dist/analyzer/symbolNameUtils.js.map +1 -1
  115. package/dist/analyzer/symbolUtils.js +4 -5
  116. package/dist/analyzer/symbolUtils.js.map +1 -1
  117. package/dist/analyzer/testWalker.js.map +1 -1
  118. package/dist/analyzer/tracePrinter.js +5 -4
  119. package/dist/analyzer/tracePrinter.js.map +1 -1
  120. package/dist/analyzer/tuples.d.ts +2 -2
  121. package/dist/analyzer/tuples.js +14 -14
  122. package/dist/analyzer/tuples.js.map +1 -1
  123. package/dist/analyzer/typeCacheUtils.js.map +1 -1
  124. package/dist/analyzer/typeComplexity.js +14 -7
  125. package/dist/analyzer/typeComplexity.js.map +1 -1
  126. package/dist/analyzer/typeDocStringUtils.d.ts +2 -2
  127. package/dist/analyzer/typeDocStringUtils.js +34 -25
  128. package/dist/analyzer/typeDocStringUtils.js.map +1 -1
  129. package/dist/analyzer/typeEvaluator.js +1021 -993
  130. package/dist/analyzer/typeEvaluator.js.map +1 -1
  131. package/dist/analyzer/typeEvaluatorTypes.d.ts +31 -13
  132. package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
  133. package/dist/analyzer/typeEvaluatorWithTracker.js +1 -2
  134. package/dist/analyzer/typeEvaluatorWithTracker.js.map +1 -1
  135. package/dist/analyzer/typeGuards.js +72 -64
  136. package/dist/analyzer/typeGuards.js.map +1 -1
  137. package/dist/analyzer/typePrinter.js +28 -26
  138. package/dist/analyzer/typePrinter.js.map +1 -1
  139. package/dist/analyzer/typeStubWriter.js.map +1 -1
  140. package/dist/analyzer/typeUtils.d.ts +36 -38
  141. package/dist/analyzer/typeUtils.js +465 -746
  142. package/dist/analyzer/typeUtils.js.map +1 -1
  143. package/dist/analyzer/typeWalker.d.ts +2 -2
  144. package/dist/analyzer/typeWalker.js +10 -5
  145. package/dist/analyzer/typeWalker.js.map +1 -1
  146. package/dist/analyzer/typedDicts.d.ts +2 -2
  147. package/dist/analyzer/typedDicts.js +52 -52
  148. package/dist/analyzer/typedDicts.js.map +1 -1
  149. package/dist/analyzer/types.d.ts +41 -36
  150. package/dist/analyzer/types.js +178 -184
  151. package/dist/analyzer/types.js.map +1 -1
  152. package/dist/backgroundAnalysisBase.d.ts +0 -1
  153. package/dist/backgroundAnalysisBase.js.map +1 -1
  154. package/dist/backgroundThreadBase.d.ts +0 -1
  155. package/dist/backgroundThreadBase.js +7 -7
  156. package/dist/backgroundThreadBase.js.map +1 -1
  157. package/dist/commands/commandController.js.map +1 -1
  158. package/dist/commands/createTypeStub.js.map +1 -1
  159. package/dist/commands/dumpFileDebugInfoCommand.js +2 -2
  160. package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
  161. package/dist/commands/quickActionCommand.js.map +1 -1
  162. package/dist/common/cancellationUtils.js +9 -9
  163. package/dist/common/cancellationUtils.js.map +1 -1
  164. package/dist/common/chokidarFileWatcherProvider.js +3 -3
  165. package/dist/common/chokidarFileWatcherProvider.js.map +1 -1
  166. package/dist/common/collectionUtils.js +23 -23
  167. package/dist/common/collectionUtils.js.map +1 -1
  168. package/dist/common/commandLineOptions.d.ts +19 -12
  169. package/dist/common/commandLineOptions.js +26 -9
  170. package/dist/common/commandLineOptions.js.map +1 -1
  171. package/dist/common/commandUtils.js +1 -2
  172. package/dist/common/commandUtils.js.map +1 -1
  173. package/dist/common/configOptions.d.ts +2 -2
  174. package/dist/common/configOptions.js +30 -40
  175. package/dist/common/configOptions.js.map +1 -1
  176. package/dist/common/console.js +4 -4
  177. package/dist/common/console.js.map +1 -1
  178. package/dist/common/core.js +21 -21
  179. package/dist/common/core.js.map +1 -1
  180. package/dist/common/crypto.js +1 -2
  181. package/dist/common/crypto.js.map +1 -1
  182. package/dist/common/debug.js +9 -10
  183. package/dist/common/debug.js.map +1 -1
  184. package/dist/common/deferred.js +3 -4
  185. package/dist/common/deferred.js.map +1 -1
  186. package/dist/common/diagnostic.js +3 -3
  187. package/dist/common/diagnostic.js.map +1 -1
  188. package/dist/common/diagnosticSink.js.map +1 -1
  189. package/dist/common/envVarUtils.js +2 -3
  190. package/dist/common/envVarUtils.js.map +1 -1
  191. package/dist/common/fileBasedCancellationUtils.js +4 -4
  192. package/dist/common/fileBasedCancellationUtils.js.map +1 -1
  193. package/dist/common/fileSystem.d.ts +0 -2
  194. package/dist/common/fileWatcher.js +2 -2
  195. package/dist/common/fileWatcher.js.map +1 -1
  196. package/dist/common/fullAccessHost.js.map +1 -1
  197. package/dist/common/logTracker.js +2 -2
  198. package/dist/common/logTracker.js.map +1 -1
  199. package/dist/common/lspUtils.d.ts +1 -1
  200. package/dist/common/lspUtils.js +3 -4
  201. package/dist/common/lspUtils.js.map +1 -1
  202. package/dist/common/memUtils.js +2 -2
  203. package/dist/common/memUtils.js.map +1 -1
  204. package/dist/common/pathUtils.js +32 -32
  205. package/dist/common/pathUtils.js.map +1 -1
  206. package/dist/common/positionUtils.js +7 -8
  207. package/dist/common/positionUtils.js.map +1 -1
  208. package/dist/common/progressReporter.js.map +1 -1
  209. package/dist/common/pythonVersion.js.map +1 -1
  210. package/dist/common/realFileSystem.d.ts +0 -2
  211. package/dist/common/realFileSystem.js +2 -2
  212. package/dist/common/realFileSystem.js.map +1 -1
  213. package/dist/common/serviceProvider.js.map +1 -1
  214. package/dist/common/serviceProviderExtensions.js +1 -2
  215. package/dist/common/serviceProviderExtensions.js.map +1 -1
  216. package/dist/common/stringUtils.js +12 -13
  217. package/dist/common/stringUtils.js.map +1 -1
  218. package/dist/common/textEditTracker.js.map +1 -1
  219. package/dist/common/textRange.js +13 -13
  220. package/dist/common/textRange.js.map +1 -1
  221. package/dist/common/textRangeCollection.js +2 -2
  222. package/dist/common/textRangeCollection.js.map +1 -1
  223. package/dist/common/timing.js.map +1 -1
  224. package/dist/common/uri/baseUri.js.map +1 -1
  225. package/dist/common/uri/fileUri.js.map +1 -1
  226. package/dist/common/uri/memoization.js +3 -4
  227. package/dist/common/uri/memoization.js.map +1 -1
  228. package/dist/common/uri/uri.js.map +1 -1
  229. package/dist/common/uri/uriUtils.d.ts +0 -1
  230. package/dist/common/uri/uriUtils.js +20 -20
  231. package/dist/common/uri/uriUtils.js.map +1 -1
  232. package/dist/common/uri/webUri.js.map +1 -1
  233. package/dist/common/workspaceEditUtils.js +8 -9
  234. package/dist/common/workspaceEditUtils.js.map +1 -1
  235. package/dist/languageServerBase.d.ts +2 -2
  236. package/dist/languageServerBase.js +5 -2
  237. package/dist/languageServerBase.js.map +1 -1
  238. package/dist/languageService/analyzerServiceExecutor.js +30 -29
  239. package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
  240. package/dist/languageService/autoImporter.js +4 -4
  241. package/dist/languageService/autoImporter.js.map +1 -1
  242. package/dist/languageService/callHierarchyProvider.js.map +1 -1
  243. package/dist/languageService/codeActionProvider.js.map +1 -1
  244. package/dist/languageService/completionProvider.js +4 -4
  245. package/dist/languageService/completionProvider.js.map +1 -1
  246. package/dist/languageService/completionProviderUtils.js +4 -5
  247. package/dist/languageService/completionProviderUtils.js.map +1 -1
  248. package/dist/languageService/definitionProvider.js +5 -5
  249. package/dist/languageService/definitionProvider.js.map +1 -1
  250. package/dist/languageService/documentHighlightProvider.js.map +1 -1
  251. package/dist/languageService/documentSymbolCollector.js +3 -3
  252. package/dist/languageService/documentSymbolCollector.js.map +1 -1
  253. package/dist/languageService/documentSymbolProvider.js +2 -2
  254. package/dist/languageService/documentSymbolProvider.js.map +1 -1
  255. package/dist/languageService/dynamicFeature.js.map +1 -1
  256. package/dist/languageService/fileWatcherDynamicFeature.js.map +1 -1
  257. package/dist/languageService/hoverProvider.js +6 -6
  258. package/dist/languageService/hoverProvider.js.map +1 -1
  259. package/dist/languageService/importSorter.js.map +1 -1
  260. package/dist/languageService/navigationUtils.js +3 -4
  261. package/dist/languageService/navigationUtils.js.map +1 -1
  262. package/dist/languageService/quickActions.js +1 -2
  263. package/dist/languageService/quickActions.js.map +1 -1
  264. package/dist/languageService/referencesProvider.js.map +1 -1
  265. package/dist/languageService/renameProvider.js.map +1 -1
  266. package/dist/languageService/signatureHelpProvider.js.map +1 -1
  267. package/dist/languageService/symbolIndexer.js.map +1 -1
  268. package/dist/languageService/tooltipUtils.d.ts +5 -5
  269. package/dist/languageService/tooltipUtils.js +31 -31
  270. package/dist/languageService/tooltipUtils.js.map +1 -1
  271. package/dist/languageService/workspaceSymbolProvider.js.map +1 -1
  272. package/dist/localization/localize.d.ts +3 -0
  273. package/dist/localization/localize.js +7 -6
  274. package/dist/localization/localize.js.map +1 -1
  275. package/dist/localization/package.nls.en-us.json +2 -1
  276. package/dist/nodeMain.js +1 -2
  277. package/dist/nodeMain.js.map +1 -1
  278. package/dist/nodeServer.js +2 -3
  279. package/dist/nodeServer.js.map +1 -1
  280. package/dist/parser/characterStream.js.map +1 -1
  281. package/dist/parser/characters.js +10 -11
  282. package/dist/parser/characters.js.map +1 -1
  283. package/dist/parser/parseNodes.d.ts +8 -8
  284. package/dist/parser/parseNodes.js +5 -5
  285. package/dist/parser/parseNodes.js.map +1 -1
  286. package/dist/parser/parser.js.map +1 -1
  287. package/dist/parser/stringTokenUtils.js +2 -2
  288. package/dist/parser/stringTokenUtils.js.map +1 -1
  289. package/dist/parser/tokenizer.js.map +1 -1
  290. package/dist/parser/unicode.js +468 -468
  291. package/dist/parser/unicode.js.map +1 -1
  292. package/dist/pprof/profiler.js +2 -3
  293. package/dist/pprof/profiler.js.map +1 -1
  294. package/dist/pyright.js +22 -23
  295. package/dist/pyright.js.map +1 -1
  296. package/dist/pyrightFileSystem.d.ts +0 -2
  297. package/dist/pyrightFileSystem.js.map +1 -1
  298. package/dist/readonlyAugmentedFileSystem.d.ts +0 -2
  299. package/dist/readonlyAugmentedFileSystem.js.map +1 -1
  300. package/dist/server.js.map +1 -1
  301. package/dist/tests/cacheManager.test.js.map +1 -1
  302. package/dist/tests/chainedSourceFiles.test.js.map +1 -1
  303. package/dist/tests/checker.test.js +13 -5
  304. package/dist/tests/checker.test.js.map +1 -1
  305. package/dist/tests/classDeclaration.test.js.map +1 -1
  306. package/dist/tests/config.test.js +160 -24
  307. package/dist/tests/config.test.js.map +1 -1
  308. package/dist/tests/debug.test.js.map +1 -1
  309. package/dist/tests/diagnosticOverrides.test.js.map +1 -1
  310. package/dist/tests/docStringConversion.test.js +1 -2
  311. package/dist/tests/docStringConversion.test.js.map +1 -1
  312. package/dist/tests/documentSymbolCollector.test.js.map +1 -1
  313. package/dist/tests/filesystem.test.js.map +1 -1
  314. package/dist/tests/fourSlashParser.test.js.map +1 -1
  315. package/dist/tests/fourSlashRunner.test.js.map +1 -1
  316. package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.d.ts +0 -1
  317. package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.js.map +1 -1
  318. package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.d.ts +0 -1
  319. package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.js.map +1 -1
  320. package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.d.ts +0 -1
  321. package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.d.ts +0 -1
  322. package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.d.ts +0 -1
  323. package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.js.map +1 -1
  324. package/dist/tests/fourslash/completions.autoimport.fourslash.d.ts +0 -1
  325. package/dist/tests/fourslash/completions.autoimport.fourslash.js.map +1 -1
  326. package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.d.ts +0 -1
  327. package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.js.map +1 -1
  328. package/dist/tests/fourslash/completions.autoimport.lib.alias.fourslash.d.ts +0 -1
  329. package/dist/tests/fourslash/completions.autoimport.lib.alias.fourslash.js.map +1 -1
  330. package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.d.ts +0 -1
  331. package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.js.map +1 -1
  332. package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.d.ts +0 -1
  333. package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.js.map +1 -1
  334. package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.d.ts +0 -1
  335. package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.js.map +1 -1
  336. package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.d.ts +0 -1
  337. package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.js.map +1 -1
  338. package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.d.ts +0 -1
  339. package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.js.map +1 -1
  340. package/dist/tests/fourslash/completions.builtinOverride.fourslash.d.ts +0 -1
  341. package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.d.ts +0 -1
  342. package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.js.map +1 -1
  343. package/dist/tests/fourslash/completions.call.typedDict.fourslash.d.ts +0 -1
  344. package/dist/tests/fourslash/completions.call.typedDict.fourslash.js.map +1 -1
  345. package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.d.ts +0 -1
  346. package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.js.map +1 -1
  347. package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.d.ts +0 -1
  348. package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.js.map +1 -1
  349. package/dist/tests/fourslash/completions.classVariable.fourslash.d.ts +0 -1
  350. package/dist/tests/fourslash/completions.classVariable.fourslash.js.map +1 -1
  351. package/dist/tests/fourslash/completions.comment.fourslash.d.ts +0 -1
  352. package/dist/tests/fourslash/completions.declNames.class.fourslash.d.ts +0 -1
  353. package/dist/tests/fourslash/completions.declNames.class.fourslash.js.map +1 -1
  354. package/dist/tests/fourslash/completions.declNames.exception.fourslash.d.ts +0 -1
  355. package/dist/tests/fourslash/completions.declNames.for.fourslash.d.ts +0 -1
  356. package/dist/tests/fourslash/completions.declNames.for.fourslash.js.map +1 -1
  357. package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.d.ts +0 -1
  358. package/dist/tests/fourslash/completions.declNames.lambda.fourslash.d.ts +0 -1
  359. package/dist/tests/fourslash/completions.declNames.lambda.fourslash.js.map +1 -1
  360. package/dist/tests/fourslash/completions.declNames.method.fourslash.d.ts +0 -1
  361. package/dist/tests/fourslash/completions.declNames.method.fourslash.js.map +1 -1
  362. package/dist/tests/fourslash/completions.declNames.overload.fourslash.d.ts +0 -1
  363. package/dist/tests/fourslash/completions.declNames.overload.fourslash.js.map +1 -1
  364. package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.d.ts +0 -1
  365. package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.js.map +1 -1
  366. package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.d.ts +0 -1
  367. package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.js.map +1 -1
  368. package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.d.ts +0 -1
  369. package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.js.map +1 -1
  370. package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.d.ts +0 -1
  371. package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.js.map +1 -1
  372. package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.d.ts +0 -1
  373. package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.js.map +1 -1
  374. package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.d.ts +0 -1
  375. package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.js.map +1 -1
  376. package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.d.ts +0 -1
  377. package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.js.map +1 -1
  378. package/dist/tests/fourslash/completions.dunderNew.Inheritance.fourslash.d.ts +0 -1
  379. package/dist/tests/fourslash/completions.dunderNew.fourslash.d.ts +0 -1
  380. package/dist/tests/fourslash/completions.enums.members.fourslash.d.ts +0 -1
  381. package/dist/tests/fourslash/completions.errorNodes.fourslash.d.ts +0 -1
  382. package/dist/tests/fourslash/completions.excluded.fourslash.d.ts +0 -1
  383. package/dist/tests/fourslash/completions.fourslash.d.ts +0 -1
  384. package/dist/tests/fourslash/completions.fstring.fourslash.d.ts +0 -1
  385. package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.d.ts +0 -1
  386. package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.js.map +1 -1
  387. package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.d.ts +0 -1
  388. package/dist/tests/fourslash/completions.import.dunderNames.fourslash.d.ts +0 -1
  389. package/dist/tests/fourslash/completions.import.exactMatch.fourslash.d.ts +0 -1
  390. package/dist/tests/fourslash/completions.import.excludeAlreadyImported.fourslash.d.ts +0 -1
  391. package/dist/tests/fourslash/completions.import.interimFile.fourslash.disabled.d.ts +0 -1
  392. package/dist/tests/fourslash/completions.import.interimFile.fourslash.disabled.js.map +1 -1
  393. package/dist/tests/fourslash/completions.import.submodule.fourslash.d.ts +0 -1
  394. package/dist/tests/fourslash/completions.inList.fourslash.d.ts +0 -1
  395. package/dist/tests/fourslash/completions.inList.fourslash.js.map +1 -1
  396. package/dist/tests/fourslash/completions.included.fourslash.d.ts +0 -1
  397. package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.d.ts +0 -1
  398. package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.js.map +1 -1
  399. package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.d.ts +0 -1
  400. package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.d.ts +0 -1
  401. package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.d.ts +0 -1
  402. package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.d.ts +0 -1
  403. package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.d.ts +0 -1
  404. package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.d.ts +0 -1
  405. package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.js.map +1 -1
  406. package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.d.ts +0 -1
  407. package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.d.ts +0 -1
  408. package/dist/tests/fourslash/completions.libStub.fourslash.d.ts +0 -1
  409. package/dist/tests/fourslash/completions.literals.fourslash.d.ts +0 -1
  410. package/dist/tests/fourslash/completions.literals.fourslash.js.map +1 -1
  411. package/dist/tests/fourslash/completions.localCode.fourslash.d.ts +0 -1
  412. package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.d.ts +0 -1
  413. package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.d.ts +0 -1
  414. package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.d.ts +0 -1
  415. package/dist/tests/fourslash/completions.overloads.fourslash.d.ts +0 -1
  416. package/dist/tests/fourslash/completions.override.default.fourslash.d.ts +0 -1
  417. package/dist/tests/fourslash/completions.override.default.importStub.d.ts +0 -1
  418. package/dist/tests/fourslash/completions.override.default.imported.fourslash.d.ts +0 -1
  419. package/dist/tests/fourslash/completions.override.default.stub.fourslash.d.ts +0 -1
  420. package/dist/tests/fourslash/completions.override.fourslash.d.ts +0 -1
  421. package/dist/tests/fourslash/completions.override.property.fourslash.d.ts +0 -1
  422. package/dist/tests/fourslash/completions.override.property.stub.fourslash.d.ts +0 -1
  423. package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.d.ts +0 -1
  424. package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.js.map +1 -1
  425. package/dist/tests/fourslash/completions.override.stub.fourslash.d.ts +0 -1
  426. package/dist/tests/fourslash/completions.override2.fourslash.d.ts +0 -1
  427. package/dist/tests/fourslash/completions.override2.fourslash.js.map +1 -1
  428. package/dist/tests/fourslash/completions.parameters.fourslash.d.ts +0 -1
  429. package/dist/tests/fourslash/completions.params.fourslash.d.ts +0 -1
  430. package/dist/tests/fourslash/completions.parentFolder.fourslash.d.ts +0 -1
  431. package/dist/tests/fourslash/completions.parentFolders.fourslash.d.ts +0 -1
  432. package/dist/tests/fourslash/completions.parentFolders.fourslash.js.map +1 -1
  433. package/dist/tests/fourslash/completions.plainText.fourslash.d.ts +0 -1
  434. package/dist/tests/fourslash/completions.private.fourslash.d.ts +0 -1
  435. package/dist/tests/fourslash/completions.private.fourslash.js.map +1 -1
  436. package/dist/tests/fourslash/completions.property.fourslash.d.ts +0 -1
  437. package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.d.ts +0 -1
  438. package/dist/tests/fourslash/completions.self.fourslash.d.ts +0 -1
  439. package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.d.ts +0 -1
  440. package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.js.map +1 -1
  441. package/dist/tests/fourslash/completions.stringLiteral.fourslash.d.ts +0 -1
  442. package/dist/tests/fourslash/completions.stringLiteral.fourslash.js.map +1 -1
  443. package/dist/tests/fourslash/completions.triggers.fourslash.d.ts +0 -1
  444. package/dist/tests/fourslash/completions.triggers.fourslash.js.map +1 -1
  445. package/dist/tests/fourslash/completions.typeAlias.fourslash.d.ts +0 -1
  446. package/dist/tests/fourslash/completions.typeshed.fourslash.d.ts +0 -1
  447. package/dist/tests/fourslash/completions.vardecls.fourslash.d.ts +0 -1
  448. package/dist/tests/fourslash/completions.vardecls.fourslash.js.map +1 -1
  449. package/dist/tests/fourslash/completions.variableDocStrings.fourslash.d.ts +0 -1
  450. package/dist/tests/fourslash/completions.wildcardimports.fourslash.d.ts +0 -1
  451. package/dist/tests/fourslash/completions.with.fourslash.d.ts +0 -1
  452. package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.d.ts +0 -1
  453. package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.js.map +1 -1
  454. package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.d.ts +0 -1
  455. package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.js.map +1 -1
  456. package/dist/tests/fourslash/findDefinitions.classes.fourslash.d.ts +0 -1
  457. package/dist/tests/fourslash/findDefinitions.classes.fourslash.js.map +1 -1
  458. package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.d.ts +0 -1
  459. package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.js.map +1 -1
  460. package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.d.ts +0 -1
  461. package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.js.map +1 -1
  462. package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.d.ts +0 -1
  463. package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.js.map +1 -1
  464. package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.d.ts +0 -1
  465. package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.js.map +1 -1
  466. package/dist/tests/fourslash/findDefinitions.fields.fourslash.d.ts +0 -1
  467. package/dist/tests/fourslash/findDefinitions.fields.fourslash.js.map +1 -1
  468. package/dist/tests/fourslash/findDefinitions.functions.fourslash.d.ts +0 -1
  469. package/dist/tests/fourslash/findDefinitions.functions.fourslash.js.map +1 -1
  470. package/dist/tests/fourslash/findDefinitions.methods.fourslash.d.ts +0 -1
  471. package/dist/tests/fourslash/findDefinitions.methods.fourslash.js.map +1 -1
  472. package/dist/tests/fourslash/findDefinitions.modules.fourslash.d.ts +0 -1
  473. package/dist/tests/fourslash/findDefinitions.modules.fourslash.js.map +1 -1
  474. package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.d.ts +0 -1
  475. package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.js.map +1 -1
  476. package/dist/tests/fourslash/findDefinitions.namespaceImportWithInit.fourslash.d.ts +0 -1
  477. package/dist/tests/fourslash/findDefinitions.namespaceImportWithInit.fourslash.js.map +1 -1
  478. package/dist/tests/fourslash/findDefinitions.overloads.fourslash.d.ts +0 -1
  479. package/dist/tests/fourslash/findDefinitions.overloads.fourslash.js.map +1 -1
  480. package/dist/tests/fourslash/findDefinitions.parameters.fourslash.d.ts +0 -1
  481. package/dist/tests/fourslash/findDefinitions.parameters.fourslash.js.map +1 -1
  482. package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.d.ts +0 -1
  483. package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.js.map +1 -1
  484. package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.d.ts +0 -1
  485. package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.js.map +1 -1
  486. package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.d.ts +0 -1
  487. package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.js.map +1 -1
  488. package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.d.ts +0 -1
  489. package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.js.map +1 -1
  490. package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.d.ts +0 -1
  491. package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.js.map +1 -1
  492. package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.d.ts +0 -1
  493. package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.js.map +1 -1
  494. package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.d.ts +0 -1
  495. package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.js.map +1 -1
  496. package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.d.ts +0 -1
  497. package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.js.map +1 -1
  498. package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.d.ts +0 -1
  499. package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.js.map +1 -1
  500. package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.d.ts +0 -1
  501. package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.js.map +1 -1
  502. package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.d.ts +0 -1
  503. package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.js.map +1 -1
  504. package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.d.ts +0 -1
  505. package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.js.map +1 -1
  506. package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.d.ts +0 -1
  507. package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.js.map +1 -1
  508. package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.d.ts +0 -1
  509. package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.js.map +1 -1
  510. package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.d.ts +0 -1
  511. package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.js.map +1 -1
  512. package/dist/tests/fourslash/findDefinitions.variables.fourslash.d.ts +0 -1
  513. package/dist/tests/fourslash/findDefinitions.variables.fourslash.js.map +1 -1
  514. package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.d.ts +0 -1
  515. package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.js.map +1 -1
  516. package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.d.ts +0 -1
  517. package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.js.map +1 -1
  518. package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.d.ts +0 -1
  519. package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.js.map +1 -1
  520. package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.d.ts +0 -1
  521. package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.js.map +1 -1
  522. package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.d.ts +0 -1
  523. package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.js.map +1 -1
  524. package/dist/tests/fourslash/findallreferences.fourslash.d.ts +0 -1
  525. package/dist/tests/fourslash/findallreferences.fourslash.js.map +1 -1
  526. package/dist/tests/fourslash/findallreferences.importalias.fourslash.d.ts +0 -1
  527. package/dist/tests/fourslash/findallreferences.importalias.fourslash.js.map +1 -1
  528. package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.d.ts +0 -1
  529. package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.js.map +1 -1
  530. package/dist/tests/fourslash/findallreferences.module.nested.fourslash.d.ts +0 -1
  531. package/dist/tests/fourslash/findallreferences.module.nested.fourslash.js.map +1 -1
  532. package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.d.ts +0 -1
  533. package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.js.map +1 -1
  534. package/dist/tests/fourslash/findallreferences.modules.fourslash.d.ts +0 -1
  535. package/dist/tests/fourslash/findallreferences.modules.fourslash.js.map +1 -1
  536. package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.d.ts +0 -1
  537. package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.js.map +1 -1
  538. package/dist/tests/fourslash/findallreferences.openFiles.fourslash.d.ts +0 -1
  539. package/dist/tests/fourslash/findallreferences.openFiles.fourslash.js.map +1 -1
  540. package/dist/tests/fourslash/findallreferences.parameter.fourslash.d.ts +0 -1
  541. package/dist/tests/fourslash/findallreferences.parameter.fourslash.js.map +1 -1
  542. package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.d.ts +0 -1
  543. package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.js.map +1 -1
  544. package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.d.ts +0 -1
  545. package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.js.map +1 -1
  546. package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.d.ts +0 -1
  547. package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.js.map +1 -1
  548. package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.d.ts +0 -1
  549. package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.js.map +1 -1
  550. package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.d.ts +0 -1
  551. package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.js.map +1 -1
  552. package/dist/tests/fourslash/findallreferences.variable.fourslash.d.ts +0 -1
  553. package/dist/tests/fourslash/findallreferences.variable.fourslash.js.map +1 -1
  554. package/dist/tests/fourslash/highlightreferences.attributes.fourslash.d.ts +0 -1
  555. package/dist/tests/fourslash/highlightreferences.attributes.fourslash.js.map +1 -1
  556. package/dist/tests/fourslash/hover.async.fourslash.d.ts +0 -1
  557. package/dist/tests/fourslash/hover.builtinDocstrings.builtinInheritedByBuiltin.fourslash.d.ts +0 -1
  558. package/dist/tests/fourslash/hover.builtinDocstrings.builtinInheritedByUserCode.fourslash.d.ts +0 -1
  559. package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.d.ts +0 -1
  560. package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.js.map +1 -1
  561. package/dist/tests/fourslash/hover.class.docString.fourslash.d.ts +0 -1
  562. package/dist/tests/fourslash/hover.classNoInit.fourslash.d.ts +0 -1
  563. package/dist/tests/fourslash/hover.docFromSrc.fourslash.d.ts +0 -1
  564. package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.d.ts +0 -1
  565. package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.d.ts +0 -1
  566. package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.d.ts +0 -1
  567. package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.d.ts +0 -1
  568. package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.d.ts +0 -1
  569. package/dist/tests/fourslash/hover.docFromSrc.stringFormat.fourslash.d.ts +0 -1
  570. package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.d.ts +0 -1
  571. package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.d.ts +0 -1
  572. package/dist/tests/fourslash/hover.docstring.alias.fourslash.d.ts +0 -1
  573. package/dist/tests/fourslash/hover.docstring.links.fourslash.d.ts +0 -1
  574. package/dist/tests/fourslash/hover.docstring.overloads.fourslash.d.ts +0 -1
  575. package/dist/tests/fourslash/hover.docstring.parameter.fourslash.d.ts +0 -1
  576. package/dist/tests/fourslash/hover.docstring.split.fourslash.d.ts +0 -1
  577. package/dist/tests/fourslash/hover.dunderNew.basic.fourslash.d.ts +0 -1
  578. package/dist/tests/fourslash/hover.dunderNew.inheritance.fourslash.d.ts +0 -1
  579. package/dist/tests/fourslash/hover.dunderNew.inheritance2.fourslash.d.ts +0 -1
  580. package/dist/tests/fourslash/hover.dunderNew.overloads.fourslash.d.ts +0 -1
  581. package/dist/tests/fourslash/hover.dunderNew.withInit.fourslash.d.ts +0 -1
  582. package/dist/tests/fourslash/hover.formatted.fourslash.d.ts +0 -1
  583. package/dist/tests/fourslash/hover.fourslash.d.ts +0 -1
  584. package/dist/tests/fourslash/hover.import.django.view.fourslash.d.ts +0 -1
  585. package/dist/tests/fourslash/hover.import.fourslash.d.ts +0 -1
  586. package/dist/tests/fourslash/hover.inferred.fourslash.d.ts +0 -1
  587. package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.d.ts +0 -1
  588. package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.d.ts +0 -1
  589. package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.d.ts +0 -1
  590. package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.d.ts +0 -1
  591. package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.d.ts +0 -1
  592. package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.d.ts +0 -1
  593. package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.d.ts +0 -1
  594. package/dist/tests/fourslash/hover.init.fourslash.d.ts +0 -1
  595. package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.d.ts +0 -1
  596. package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.d.ts +0 -1
  597. package/dist/tests/fourslash/hover.libStub.fourslash.d.ts +0 -1
  598. package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.d.ts +0 -1
  599. package/dist/tests/fourslash/hover.overloadedFunction.fourslash.d.ts +0 -1
  600. package/dist/tests/fourslash/hover.plainText.fourslash.d.ts +0 -1
  601. package/dist/tests/fourslash/hover.slots.fourslash.d.ts +0 -1
  602. package/dist/tests/fourslash/hover.typedDict.key.fourslash.d.ts +0 -1
  603. package/dist/tests/fourslash/hover.unpackedTypedDict.key.fourslash.d.ts +0 -1
  604. package/dist/tests/fourslash/hover.variable.docString.fourslash.d.ts +0 -1
  605. package/dist/tests/fourslash/hover.wildcardimports.fourslash.d.ts +0 -1
  606. package/dist/tests/fourslash/import.multipart.fourslash.d.ts +0 -1
  607. package/dist/tests/fourslash/import.nameconflict.fourslash.d.ts +0 -1
  608. package/dist/tests/fourslash/import.publicSymbols.fourslash.d.ts +0 -1
  609. package/dist/tests/fourslash/import.publicSymbols.fourslash.js.map +1 -1
  610. package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.d.ts +0 -1
  611. package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.d.ts +0 -1
  612. package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.d.ts +0 -1
  613. package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.d.ts +0 -1
  614. package/dist/tests/fourslash/import.wildcard.fourslash.d.ts +0 -1
  615. package/dist/tests/fourslash/importnotresolved.fourslash.d.ts +0 -1
  616. package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.d.ts +0 -1
  617. package/dist/tests/fourslash/missingModuleSource.fourslash.d.ts +0 -1
  618. package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.d.ts +0 -1
  619. package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.d.ts +0 -1
  620. package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.d.ts +0 -1
  621. package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.d.ts +0 -1
  622. package/dist/tests/fourslash/missingTypeStub.command.trycatchImport.fourslash.d.ts +0 -1
  623. package/dist/tests/fourslash/missingTypeStub.fourslash.d.ts +0 -1
  624. package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.d.ts +0 -1
  625. package/dist/tests/fourslash/noerrors.fourslash.d.ts +0 -1
  626. package/dist/tests/fourslash/orderImports1.command.fourslash.d.ts +0 -1
  627. package/dist/tests/fourslash/orderImports2.command.fourslash.d.ts +0 -1
  628. package/dist/tests/fourslash/rename.args.fourslash.d.ts +0 -1
  629. package/dist/tests/fourslash/rename.args.fourslash.js.map +1 -1
  630. package/dist/tests/fourslash/rename.externallyHidden.fourslash.d.ts +0 -1
  631. package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.d.ts +0 -1
  632. package/dist/tests/fourslash/rename.fourslash.d.ts +0 -1
  633. package/dist/tests/fourslash/rename.fourslash.js.map +1 -1
  634. package/dist/tests/fourslash/rename.function.untitledFile.fourslash.d.ts +0 -1
  635. package/dist/tests/fourslash/rename.function.untitledFile.fourslash.js.map +1 -1
  636. package/dist/tests/fourslash/rename.init.fourslash.d.ts +0 -1
  637. package/dist/tests/fourslash/rename.init.fourslash.js.map +1 -1
  638. package/dist/tests/fourslash/rename.library.fourslash.d.ts +0 -1
  639. package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.d.ts +0 -1
  640. package/dist/tests/fourslash/rename.multipleDecl.fourslash.d.ts +0 -1
  641. package/dist/tests/fourslash/rename.parens.fourslash.d.ts +0 -1
  642. package/dist/tests/fourslash/rename.parens.fourslash.js.map +1 -1
  643. package/dist/tests/fourslash/rename.sourceAndStub.fourslash.d.ts +0 -1
  644. package/dist/tests/fourslash/rename.sourceAndStub.fourslash.js.map +1 -1
  645. package/dist/tests/fourslash/rename.string.excluded.fourslash.d.ts +0 -1
  646. package/dist/tests/fourslash/rename.string.excluded.fourslash.js.map +1 -1
  647. package/dist/tests/fourslash/rename.string.fourslash.d.ts +0 -1
  648. package/dist/tests/fourslash/rename.string.fourslash.js.map +1 -1
  649. package/dist/tests/fourslash/shadowedImports.fourslash.d.ts +0 -1
  650. package/dist/tests/fourslash/showcallhierarchy.incomingCalls.aliasedFunction.fourslash.d.ts +0 -1
  651. package/dist/tests/fourslash/showcallhierarchy.incomingCalls.aliasedFunction.fourslash.js.map +1 -1
  652. package/dist/tests/fourslash/showcallhierarchy.incomingCalls.aliasedVariable.fourslash.d.ts +0 -1
  653. package/dist/tests/fourslash/showcallhierarchy.incomingCalls.aliasedVariable.fourslash.js.map +1 -1
  654. package/dist/tests/fourslash/showcallhierarchy.incomingCalls.function.fourslash.d.ts +0 -1
  655. package/dist/tests/fourslash/showcallhierarchy.incomingCalls.function.fourslash.js.map +1 -1
  656. package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.aliasedFunction1.fourslash.d.ts +0 -1
  657. package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.aliasedFunction1.fourslash.js.map +1 -1
  658. package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.aliasedFunction2.fourslash.d.ts +0 -1
  659. package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.aliasedFunction2.fourslash.js.map +1 -1
  660. package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.function.fourslash.d.ts +0 -1
  661. package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.function.fourslash.js.map +1 -1
  662. package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.d.ts +0 -1
  663. package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js.map +1 -1
  664. package/dist/tests/fourslash/signature.complicated.fourslash.d.ts +0 -1
  665. package/dist/tests/fourslash/signature.complicated.fourslash.js.map +1 -1
  666. package/dist/tests/fourslash/signature.cornercases.fourslash.d.ts +0 -1
  667. package/dist/tests/fourslash/signature.cornercases.fourslash.js.map +1 -1
  668. package/dist/tests/fourslash/signature.docstrings.fourslash.d.ts +0 -1
  669. package/dist/tests/fourslash/signature.docstrings.fourslash.js.map +1 -1
  670. package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.d.ts +0 -1
  671. package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.js.map +1 -1
  672. package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.d.ts +0 -1
  673. package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.js.map +1 -1
  674. package/dist/tests/fourslash/signature.dunderNew.fourslash.d.ts +0 -1
  675. package/dist/tests/fourslash/signature.dunderNew.fourslash.js.map +1 -1
  676. package/dist/tests/fourslash/signature.overload.fourslash.d.ts +0 -1
  677. package/dist/tests/fourslash/signature.overload.fourslash.js.map +1 -1
  678. package/dist/tests/fourslash/signature.simple.fourslash.d.ts +0 -1
  679. package/dist/tests/fourslash/signature.simple.fourslash.js.map +1 -1
  680. package/dist/tests/fourslash/typeVerifier.fourslash.d.ts +0 -1
  681. package/dist/tests/fourslash/typeVerifier.fourslash.js.map +1 -1
  682. package/dist/tests/harness/fourslash/fourSlashParser.js +1 -2
  683. package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -1
  684. package/dist/tests/harness/fourslash/fourSlashTypes.js.map +1 -1
  685. package/dist/tests/harness/fourslash/runner.d.ts +0 -1
  686. package/dist/tests/harness/fourslash/runner.js +2 -3
  687. package/dist/tests/harness/fourslash/runner.js.map +1 -1
  688. package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
  689. package/dist/tests/harness/fourslash/testState.js +7 -7
  690. package/dist/tests/harness/fourslash/testState.js.map +1 -1
  691. package/dist/tests/harness/fourslash/testStateUtils.js +4 -5
  692. package/dist/tests/harness/fourslash/testStateUtils.js.map +1 -1
  693. package/dist/tests/harness/fourslash/workspaceEditTestUtils.js +7 -8
  694. package/dist/tests/harness/fourslash/workspaceEditTestUtils.js.map +1 -1
  695. package/dist/tests/harness/testHost.js.map +1 -1
  696. package/dist/tests/harness/utils.d.ts +0 -2
  697. package/dist/tests/harness/utils.js +7 -7
  698. package/dist/tests/harness/utils.js.map +1 -1
  699. package/dist/tests/harness/vfs/factory.js +3 -3
  700. package/dist/tests/harness/vfs/factory.js.map +1 -1
  701. package/dist/tests/harness/vfs/filesystem.d.ts +0 -2
  702. package/dist/tests/harness/vfs/filesystem.js +2 -2
  703. package/dist/tests/harness/vfs/filesystem.js.map +1 -1
  704. package/dist/tests/harness/vfs/pathValidation.js +2 -2
  705. package/dist/tests/harness/vfs/pathValidation.js.map +1 -1
  706. package/dist/tests/importResolver.test.js.map +1 -1
  707. package/dist/tests/importStatementUtils.test.js.map +1 -1
  708. package/dist/tests/ipythonMode.test.js.map +1 -1
  709. package/dist/tests/languageServer.test.js.map +1 -1
  710. package/dist/tests/localizer.test.js.map +1 -1
  711. package/dist/tests/lsp/languageServer.js +1 -2
  712. package/dist/tests/lsp/languageServer.js.map +1 -1
  713. package/dist/tests/lsp/languageServerTestUtils.js +14 -14
  714. package/dist/tests/lsp/languageServerTestUtils.js.map +1 -1
  715. package/dist/tests/lsp/webpack.testserver.config.d.ts +2 -2
  716. package/dist/tests/parseTreeUtils.test.js.map +1 -1
  717. package/dist/tests/pathUtils.test.js.map +1 -1
  718. package/dist/tests/pyrightFileSystem.test.js.map +1 -1
  719. package/dist/tests/serialization.test.js +1 -2
  720. package/dist/tests/serialization.test.js.map +1 -1
  721. package/dist/tests/sourceMapperUtils.test.js.map +1 -1
  722. package/dist/tests/testStateUtils.js +5 -6
  723. package/dist/tests/testStateUtils.js.map +1 -1
  724. package/dist/tests/testUtils.js +8 -9
  725. package/dist/tests/testUtils.js.map +1 -1
  726. package/dist/tests/textEditUtil.test.js.map +1 -1
  727. package/dist/tests/tokenizer.test.js.map +1 -1
  728. package/dist/tests/typeEvaluator1.test.js +7 -7
  729. package/dist/tests/typeEvaluator1.test.js.map +1 -1
  730. package/dist/tests/typeEvaluator2.test.js +20 -0
  731. package/dist/tests/typeEvaluator2.test.js.map +1 -1
  732. package/dist/tests/typeEvaluator3.test.js +6 -2
  733. package/dist/tests/typeEvaluator3.test.js.map +1 -1
  734. package/dist/tests/typeEvaluator4.test.js +3 -3
  735. package/dist/tests/typeEvaluator5.test.js +1 -1
  736. package/dist/tests/typeEvaluator6.test.js +17 -9
  737. package/dist/tests/typeEvaluator6.test.js.map +1 -1
  738. package/dist/tests/typeEvaluator7.test.js +4 -0
  739. package/dist/tests/typeEvaluator7.test.js.map +1 -1
  740. package/dist/tests/typeEvaluator8.test.js +4 -0
  741. package/dist/tests/typeEvaluator8.test.js.map +1 -1
  742. package/dist/tests/uri.test.js.map +1 -1
  743. package/dist/workspaceFactory.js +3 -3
  744. package/dist/workspaceFactory.js.map +1 -1
  745. package/package.json +2 -2
  746. package/dist/analyzer/typeVarContext.d.ts +0 -48
  747. package/dist/analyzer/typeVarContext.js +0 -288
  748. package/dist/analyzer/typeVarContext.js.map +0 -1
@@ -50,6 +50,7 @@ const localize_1 = require("../localization/localize");
50
50
  const parseNodes_1 = require("../parser/parseNodes");
51
51
  const stringTokenUtils_1 = require("../parser/stringTokenUtils");
52
52
  const AnalyzerNodeInfo = __importStar(require("./analyzerNodeInfo"));
53
+ const constraintTracker_1 = require("./constraintTracker");
53
54
  const constructors_1 = require("./constructors");
54
55
  const dataClasses_1 = require("./dataClasses");
55
56
  const declaration_1 = require("./declaration");
@@ -69,13 +70,12 @@ const sourceMapper_1 = require("./sourceMapper");
69
70
  const staticExpressions_1 = require("./staticExpressions");
70
71
  const SymbolNameUtils = __importStar(require("./symbolNameUtils"));
71
72
  const symbolUtils_1 = require("./symbolUtils");
73
+ const typedDicts_1 = require("./typedDicts");
72
74
  const typeEvaluator_1 = require("./typeEvaluator");
73
75
  const typeEvaluatorTypes_1 = require("./typeEvaluatorTypes");
74
76
  const typeGuards_1 = require("./typeGuards");
75
- const typeUtils_1 = require("./typeUtils");
76
- const typeVarContext_1 = require("./typeVarContext");
77
- const typedDicts_1 = require("./typedDicts");
78
77
  const types_1 = require("./types");
78
+ const typeUtils_1 = require("./typeUtils");
79
79
  // When enabled, this debug flag causes the code complexity of
80
80
  // functions to be emitted.
81
81
  const isPrintCodeComplexityEnabled = false;
@@ -248,14 +248,15 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
248
248
  }
249
249
  // Allow unknown and missing param types if the param is named '_'.
250
250
  if (param.d.name && param.d.name.d.value !== '_') {
251
- const functionTypeParam = functionTypeResult.functionType.shared.parameters.find((p) => { var _a; return p.name === ((_a = param.d.name) === null || _a === void 0 ? void 0 : _a.d.value); });
252
- if (functionTypeParam) {
253
- const paramType = functionTypeParam.type;
251
+ const paramIndex = functionTypeResult.functionType.shared.parameters.findIndex((p) => { var _a; return p.name === ((_a = param.d.name) === null || _a === void 0 ? void 0 : _a.d.value); });
252
+ if (paramIndex >= 0) {
253
+ const functionTypeParam = functionTypeResult.functionType.shared.parameters[paramIndex];
254
+ const paramType = types_1.FunctionType.getParamType(functionTypeResult.functionType, paramIndex);
254
255
  if (this._fileInfo.diagnosticRuleSet.reportUnknownParameterType !== 'none') {
255
256
  if ((0, types_1.isUnknown)(paramType) ||
256
257
  ((0, types_1.isTypeVar)(paramType) &&
257
258
  paramType.shared.isSynthesized &&
258
- !paramType.shared.isSynthesizedSelf)) {
259
+ !types_1.TypeVarType.isSelf(paramType))) {
259
260
  this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportUnknownParameterType, localize_1.LocMessage.paramTypeUnknown().format({ paramName: param.d.name.d.value }), param.d.name);
260
261
  }
261
262
  else if ((0, typeUtils_1.isPartlyUnknown)(paramType)) {
@@ -274,7 +275,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
274
275
  }
275
276
  else {
276
277
  // See if this is a "self" and "cls" parameter. They are exempt from this rule.
277
- if ((0, types_1.isTypeVar)(paramType) && paramType.shared.isSynthesizedSelf) {
278
+ if ((0, types_1.isTypeVar)(paramType) && types_1.TypeVarType.isSelf(paramType)) {
278
279
  hasAnnotation = true;
279
280
  }
280
281
  }
@@ -287,7 +288,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
287
288
  // Verify that an unpacked TypedDict doesn't overlap any keyword parameters.
288
289
  if (paramDetails.hasUnpackedTypedDict) {
289
290
  const kwargsIndex = functionTypeResult.functionType.shared.parameters.length - 1;
290
- const kwargsType = types_1.FunctionType.getEffectiveParamType(functionTypeResult.functionType, kwargsIndex);
291
+ const kwargsType = types_1.FunctionType.getParamType(functionTypeResult.functionType, kwargsIndex);
291
292
  if ((0, types_1.isClass)(kwargsType) && kwargsType.shared.typedDictEntries) {
292
293
  const overlappingEntries = new Set();
293
294
  kwargsType.shared.typedDictEntries.knownItems.forEach((_, name) => {
@@ -303,9 +304,10 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
303
304
  }
304
305
  }
305
306
  // Check for invalid use of ParamSpec P.args and P.kwargs.
306
- const paramSpecParams = functionTypeResult.functionType.shared.parameters.filter((param) => {
307
- if (types_1.FunctionParam.isTypeDeclared(param) && (0, types_1.isTypeVar)(param.type) && (0, types_1.isParamSpec)(param.type)) {
308
- if (param.category !== 0 /* ParamCategory.Simple */ && param.name && param.type.priv.paramSpecAccess) {
307
+ const paramSpecParams = functionTypeResult.functionType.shared.parameters.filter((param, index) => {
308
+ const paramType = types_1.FunctionType.getParamType(functionTypeResult.functionType, index);
309
+ if (types_1.FunctionParam.isTypeDeclared(param) && (0, types_1.isTypeVar)(paramType) && (0, types_1.isParamSpec)(paramType)) {
310
+ if (param.category !== 0 /* ParamCategory.Simple */ && param.name && paramType.priv.paramSpecAccess) {
309
311
  return true;
310
312
  }
311
313
  }
@@ -343,10 +345,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
343
345
  if (functionTypeResult) {
344
346
  const annotationNode = param.d.annotation || param.d.annotationComment;
345
347
  if (annotationNode && index < functionTypeResult.functionType.shared.parameters.length) {
346
- const paramType = functionTypeResult.functionType.shared.parameters[index].type;
348
+ const paramType = types_1.FunctionType.getParamType(functionTypeResult.functionType, index);
347
349
  const exemptMethods = ['__init__', '__new__'];
348
350
  if (containingClassNode &&
349
351
  (0, types_1.isTypeVar)(paramType) &&
352
+ paramType.priv.scopeType === 0 /* TypeVarScopeType.Class */ &&
350
353
  paramType.shared.declaredVariance === 3 /* Variance.Covariant */ &&
351
354
  !paramType.shared.isSynthesized &&
352
355
  !exemptMethods.some((name) => name === functionTypeResult.functionType.shared.name)) {
@@ -409,12 +412,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
409
412
  }
410
413
  }
411
414
  this._scopedNodes.push(node);
412
- if (functionTypeResult && (0, types_1.isOverloadedFunction)(functionTypeResult.decoratedType)) {
415
+ if (functionTypeResult && (0, types_1.isOverloaded)(functionTypeResult.decoratedType)) {
413
416
  // If this is the implementation for the overloaded function, skip
414
417
  // overload consistency checks.
415
- if (types_1.OverloadedFunctionType.getImplementation(functionTypeResult.decoratedType) !==
416
- functionTypeResult.functionType) {
417
- const overloads = types_1.OverloadedFunctionType.getOverloads(functionTypeResult.decoratedType);
418
+ if (types_1.OverloadedType.getImplementation(functionTypeResult.decoratedType) !== functionTypeResult.functionType) {
419
+ const overloads = types_1.OverloadedType.getOverloads(functionTypeResult.decoratedType);
418
420
  if (overloads.length > 1) {
419
421
  const maxOverloadConsistencyCheckLength = 100;
420
422
  // The check is n^2 in time, so if the number of overloads
@@ -579,33 +581,31 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
579
581
  }
580
582
  else {
581
583
  const liveScopes = ParseTreeUtils.getTypeVarScopesForNode(node);
582
- declaredReturnType = (0, typeUtils_1.updateTypeWithInternalTypeVars)(declaredReturnType, liveScopes);
583
584
  declaredReturnType = this._evaluator.stripTypeGuard(declaredReturnType);
585
+ let adjReturnType = (0, typeUtils_1.makeTypeVarsBound)(declaredReturnType, liveScopes);
584
586
  let diagAddendum = new diagnostic_1.DiagnosticAddendum();
585
587
  let returnTypeMatches = false;
586
- if (this._evaluator.assignType(declaredReturnType, returnType, diagAddendum,
587
- /* destTypeVarContext */ new typeVarContext_1.TypeVarContext())) {
588
+ if (this._evaluator.assignType(adjReturnType, returnType, diagAddendum)) {
588
589
  returnTypeMatches = true;
589
590
  }
590
591
  else {
591
592
  // See if the declared return type includes one or more constrained TypeVars. If so,
592
593
  // try to narrow these TypeVars to a single type.
593
594
  const uniqueTypeVars = (0, typeUtils_1.getTypeVarArgsRecursive)(declaredReturnType);
594
- if (uniqueTypeVars && uniqueTypeVars.some((typeVar) => typeVar.shared.constraints.length > 0)) {
595
- const typeVarContext = new typeVarContext_1.TypeVarContext();
595
+ if (uniqueTypeVars && uniqueTypeVars.some((typeVar) => types_1.TypeVarType.hasConstraints(typeVar))) {
596
+ const constraints = new constraintTracker_1.ConstraintTracker();
596
597
  for (const typeVar of uniqueTypeVars) {
597
- if (typeVar.shared.constraints.length > 0) {
598
- const narrowedType = this._evaluator.narrowConstrainedTypeVar(node, typeVar);
598
+ if (types_1.TypeVarType.hasConstraints(typeVar)) {
599
+ const narrowedType = this._evaluator.narrowConstrainedTypeVar(node, types_1.TypeVarType.cloneAsBound(typeVar));
599
600
  if (narrowedType) {
600
- (0, typeUtils_1.setTypeVarType)(typeVarContext, typeVar, narrowedType);
601
- typeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeId)(typeVar));
601
+ constraints.setBounds(typeVar, narrowedType);
602
602
  }
603
603
  }
604
604
  }
605
- if (!typeVarContext.isEmpty()) {
606
- let adjustedReturnType = (0, typeUtils_1.applySolvedTypeVars)(declaredReturnType, typeVarContext);
607
- adjustedReturnType = this._evaluator.stripTypeGuard(adjustedReturnType);
608
- if (this._evaluator.assignType(adjustedReturnType, returnType, diagAddendum)) {
605
+ if (!constraints.isEmpty()) {
606
+ adjReturnType = this._evaluator.solveAndApplyConstraints(declaredReturnType, constraints);
607
+ adjReturnType = (0, typeUtils_1.makeTypeVarsBound)(adjReturnType, liveScopes);
608
+ if (this._evaluator.assignType(adjReturnType, returnType, diagAddendum)) {
609
609
  returnTypeMatches = true;
610
610
  }
611
611
  }
@@ -763,7 +763,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
763
763
  return true;
764
764
  }
765
765
  visitAugmentedAssignment(node) {
766
- this._evaluator.evaluateTypesForStatement(node);
766
+ const typeResult = this._evaluator.getTypeResult(node);
767
+ this._reportDeprecatedUseForOperation(node.d.destExpr, typeResult);
767
768
  return true;
768
769
  }
769
770
  visitIndex(node) {
@@ -832,7 +833,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
832
833
  this._validateContainmentTypes(node);
833
834
  }
834
835
  }
835
- this._evaluator.getType(node);
836
+ const typeResult = this._evaluator.getTypeResult(node);
837
+ this._reportDeprecatedUseForOperation(node.d.leftExpr, typeResult);
836
838
  return true;
837
839
  }
838
840
  visitSlice(node) {
@@ -851,7 +853,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
851
853
  if (node.d.operator === 38 /* OperatorType.Not */) {
852
854
  this._validateConditionalIsBool(node.d.expr);
853
855
  }
854
- this._evaluator.getType(node);
856
+ const typeResult = this._evaluator.getTypeResult(node);
857
+ this._reportDeprecatedUseForOperation(node.d.expr, typeResult);
855
858
  return true;
856
859
  }
857
860
  visitTernary(node) {
@@ -1164,6 +1167,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1164
1167
  let isTypeBool = true;
1165
1168
  const diag = new diagnostic_1.DiagnosticAddendum();
1166
1169
  this._evaluator.mapSubtypesExpandTypeVars(operandType, /* options */ undefined, (expandedSubtype) => {
1170
+ var _a;
1167
1171
  if ((0, types_1.isAnyOrUnknown)(expandedSubtype)) {
1168
1172
  return undefined;
1169
1173
  }
@@ -1172,8 +1176,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1172
1176
  return undefined;
1173
1177
  }
1174
1178
  // Invoke the __bool__ method on the type.
1175
- const boolReturnType = this._evaluator.getTypeOfMagicMethodCall(expandedSubtype, '__bool__', [], node,
1176
- /* inferenceContext */ undefined);
1179
+ const boolReturnType = (_a = this._evaluator.getTypeOfMagicMethodCall(expandedSubtype, '__bool__', [], node,
1180
+ /* inferenceContext */ undefined)) === null || _a === void 0 ? void 0 : _a.type;
1177
1181
  if (!boolReturnType || (0, types_1.isAnyOrUnknown)(boolReturnType)) {
1178
1182
  return undefined;
1179
1183
  }
@@ -1213,7 +1217,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1213
1217
  let isCoroutine = true;
1214
1218
  (0, typeUtils_1.doForEachSubtype)(exprTypeResult.type, (subtype) => {
1215
1219
  subtype = this._evaluator.makeTopLevelTypeVarsConcrete(subtype);
1216
- if (!(0, types_1.isFunction)(subtype) && !(0, types_1.isOverloadedFunction)(subtype)) {
1220
+ if (!(0, types_1.isFunction)(subtype) && !(0, types_1.isOverloaded)(subtype)) {
1217
1221
  isExprFunction = false;
1218
1222
  }
1219
1223
  if (!(0, types_1.isClassInstance)(subtype) || !types_1.ClassType.isBuiltIn(subtype, 'Coroutine')) {
@@ -1406,6 +1410,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1406
1410
  isPossiblyTrue = true;
1407
1411
  }
1408
1412
  });
1413
+ (0, typeUtils_1.doForEachSubtype)(rightType, (rightSubtype) => {
1414
+ if (this._evaluator.assignType(leftType, rightSubtype)) {
1415
+ isPossiblyTrue = true;
1416
+ }
1417
+ });
1409
1418
  if (!isPossiblyTrue) {
1410
1419
  this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportUnnecessaryComparison, getMessage().format({
1411
1420
  leftType: this._evaluator.printType(leftType, { expandTypeAlias: true }),
@@ -1457,8 +1466,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1457
1466
  if ((0, typeUtils_1.isNoneInstance)(leftType) || (0, typeUtils_1.isNoneInstance)(rightType)) {
1458
1467
  return (0, types_1.isTypeSame)(leftType, rightType);
1459
1468
  }
1460
- const isLeftCallable = (0, types_1.isFunction)(leftType) || (0, types_1.isOverloadedFunction)(leftType);
1461
- const isRightCallable = (0, types_1.isFunction)(rightType) || (0, types_1.isOverloadedFunction)(rightType);
1469
+ const isLeftCallable = (0, types_1.isFunction)(leftType) || (0, types_1.isOverloaded)(leftType);
1470
+ const isRightCallable = (0, types_1.isFunction)(rightType) || (0, types_1.isOverloaded)(rightType);
1462
1471
  if (isLeftCallable !== isRightCallable) {
1463
1472
  return false;
1464
1473
  }
@@ -1582,13 +1591,13 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1582
1591
  var _a, _b, _c, _d, _e, _f, _g;
1583
1592
  const nameType = this._evaluator.getType(nameNode);
1584
1593
  ``;
1585
- if (nameType && (0, types_1.isTypeVar)(nameType) && !nameType.shared.isSynthesizedSelf) {
1594
+ if (nameType && (0, types_1.isTypeVar)(nameType) && !types_1.TypeVarType.isSelf(nameType)) {
1586
1595
  // Does this name refer to a TypeVar that is scoped to this function?
1587
1596
  if (nameType.priv.scopeId === ParseTreeUtils.getScopeIdForNode(node)) {
1588
1597
  // We exempt constrained TypeVars, TypeVars that are type arguments of
1589
1598
  // other types, and ParamSpecs. There are legitimate uses for singleton
1590
1599
  // instances in these particular cases.
1591
- let isExempt = nameType.shared.constraints.length > 0 ||
1600
+ let isExempt = types_1.TypeVarType.hasConstraints(nameType) ||
1592
1601
  nameType.shared.isDefaultExplicit ||
1593
1602
  (exemptBoundTypeVar && subscriptIndex !== undefined) ||
1594
1603
  (0, types_1.isParamSpec)(nameType);
@@ -1727,7 +1736,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1727
1736
  }
1728
1737
  // Skip this check if the function is overloaded because the TypeVar
1729
1738
  // will be solved in terms of the overload signatures.
1730
- const skipUnsolvableTypeVarCheck = (0, types_1.isOverloadedFunction)(functionTypeResult.decoratedType) &&
1739
+ const skipUnsolvableTypeVarCheck = (0, types_1.isOverloaded)(functionTypeResult.decoratedType) &&
1731
1740
  !types_1.FunctionType.isOverloaded(functionTypeResult.functionType);
1732
1741
  if (isUsedInReturnType &&
1733
1742
  usage.paramTypeWithEllipsisUsageCount > 0 &&
@@ -1760,9 +1769,18 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1760
1769
  // Validates that overloads use @staticmethod and @classmethod consistently.
1761
1770
  _validateOverloadAttributeConsistency(node, functionType) {
1762
1771
  var _a, _b, _c, _d, _e, _f;
1772
+ // Don't bother with the check if it's suppressed.
1773
+ if (this._fileInfo.diagnosticRuleSet.reportInconsistentOverload === 'none') {
1774
+ return;
1775
+ }
1763
1776
  let staticMethodCount = 0;
1764
1777
  let classMethodCount = 0;
1765
- functionType.priv.overloads.forEach((overload) => {
1778
+ const overloads = types_1.OverloadedType.getOverloads(functionType);
1779
+ if (overloads.length === 0) {
1780
+ return;
1781
+ }
1782
+ let totalMethods = overloads.length;
1783
+ overloads.forEach((overload) => {
1766
1784
  if (types_1.FunctionType.isStaticMethod(overload)) {
1767
1785
  staticMethodCount++;
1768
1786
  }
@@ -1770,19 +1788,33 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1770
1788
  classMethodCount++;
1771
1789
  }
1772
1790
  });
1773
- if (staticMethodCount > 0 && staticMethodCount < functionType.priv.overloads.length) {
1791
+ const impl = types_1.OverloadedType.getImplementation(functionType);
1792
+ if (impl && (0, types_1.isFunction)(impl)) {
1793
+ totalMethods += 1;
1794
+ if (types_1.FunctionType.isStaticMethod(impl)) {
1795
+ staticMethodCount++;
1796
+ }
1797
+ if (types_1.FunctionType.isClassMethod(impl)) {
1798
+ classMethodCount++;
1799
+ }
1800
+ }
1801
+ if (staticMethodCount > 0 && staticMethodCount < totalMethods) {
1774
1802
  this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadStaticMethodInconsistent().format({
1775
1803
  name: node.d.name.d.value,
1776
- }), (_c = (_b = (_a = functionType.priv.overloads[0]) === null || _a === void 0 ? void 0 : _a.shared.declaration) === null || _b === void 0 ? void 0 : _b.node.d.name) !== null && _c !== void 0 ? _c : node.d.name);
1804
+ }), (_c = (_b = (_a = overloads[0]) === null || _a === void 0 ? void 0 : _a.shared.declaration) === null || _b === void 0 ? void 0 : _b.node.d.name) !== null && _c !== void 0 ? _c : node.d.name);
1777
1805
  }
1778
- if (classMethodCount > 0 && classMethodCount < functionType.priv.overloads.length) {
1806
+ if (classMethodCount > 0 && classMethodCount < totalMethods) {
1779
1807
  this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadClassMethodInconsistent().format({
1780
1808
  name: node.d.name.d.value,
1781
- }), (_f = (_e = (_d = functionType.priv.overloads[0]) === null || _d === void 0 ? void 0 : _d.shared.declaration) === null || _e === void 0 ? void 0 : _e.node.d.name) !== null && _f !== void 0 ? _f : node.d.name);
1809
+ }), (_f = (_e = (_d = overloads[0]) === null || _d === void 0 ? void 0 : _d.shared.declaration) === null || _e === void 0 ? void 0 : _e.node.d.name) !== null && _f !== void 0 ? _f : node.d.name);
1782
1810
  }
1783
1811
  }
1784
1812
  // Validates that overloads do not overlap with inconsistent return results.
1785
1813
  _validateOverloadConsistency(node, functionType, prevOverloads) {
1814
+ // Skip the check entirely if it's disabled.
1815
+ if (this._fileInfo.diagnosticRuleSet.reportOverlappingOverload === 'none') {
1816
+ return;
1817
+ }
1786
1818
  for (let i = 0; i < prevOverloads.length; i++) {
1787
1819
  const prevOverload = prevOverloads[i];
1788
1820
  if (this._isOverlappingOverload(functionType, prevOverload, /* partialOverlap */ false)) {
@@ -1802,8 +1834,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1802
1834
  if (prevReturnType &&
1803
1835
  returnType &&
1804
1836
  !this._evaluator.assignType(returnType, prevReturnType,
1805
- /* diag */ undefined, new typeVarContext_1.TypeVarContext(),
1806
- /* srcTypeVarContext */ undefined, 8 /* AssignTypeFlags.SkipSolveTypeVars */ | 1024 /* AssignTypeFlags.IgnoreTypeVarScope */)) {
1837
+ /* diag */ undefined,
1838
+ /* constraints */ undefined, 0 /* AssignTypeFlags.Default */)) {
1807
1839
  const altNode = this._findNodeForOverload(node, prevOverload);
1808
1840
  this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportOverlappingOverload, localize_1.LocMessage.overloadReturnTypeMismatch().format({
1809
1841
  name: node.d.name.d.value,
@@ -1834,6 +1866,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1834
1866
  return undefined;
1835
1867
  }
1836
1868
  _isOverlappingOverload(functionType, prevOverload, partialOverlap) {
1869
+ var _a, _b, _c;
1837
1870
  // According to precedent, the __get__ method is special-cased and is
1838
1871
  // exempt from overlapping overload checks. It's not clear why this is
1839
1872
  // the case, but for consistency with other type checkers, we'll honor
@@ -1846,32 +1879,57 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
1846
1879
  if (partialOverlap) {
1847
1880
  flags |= 32 /* AssignTypeFlags.PartialOverloadOverlap */;
1848
1881
  }
1882
+ const functionNode = (_a = functionType.shared.declaration) === null || _a === void 0 ? void 0 : _a.node;
1883
+ if (functionNode) {
1884
+ const liveTypeVars = ParseTreeUtils.getTypeVarScopesForNode(functionNode);
1885
+ functionType = (0, typeUtils_1.makeTypeVarsBound)(functionType, liveTypeVars);
1886
+ }
1887
+ // Use the parent node of the declaration in this case so we don't transform
1888
+ // function-local type variables into bound type variables.
1889
+ const prevOverloadNode = (_c = (_b = prevOverload.shared.declaration) === null || _b === void 0 ? void 0 : _b.node) === null || _c === void 0 ? void 0 : _c.parent;
1890
+ if (prevOverloadNode) {
1891
+ const liveTypeVars = ParseTreeUtils.getTypeVarScopesForNode(prevOverloadNode);
1892
+ prevOverload = (0, typeUtils_1.makeTypeVarsBound)(prevOverload, liveTypeVars);
1893
+ }
1849
1894
  return this._evaluator.assignType(functionType, prevOverload,
1850
- /* diag */ undefined, new typeVarContext_1.TypeVarContext(),
1851
- /* srcTypeVarContext */ undefined, flags);
1852
- }
1853
- _isLegalOverloadImplementation(overload, implementation, diag) {
1854
- var _a;
1855
- const implTypeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(implementation));
1856
- const overloadTypeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(overload));
1895
+ /* diag */ undefined,
1896
+ /* constraints */ undefined, flags);
1897
+ }
1898
+ // Determines whether the implementation of an overload is compatible with an
1899
+ // overload signature. To be compatible, the implementation must accept all
1900
+ // of the same arguments as the overload and return a type that is consistent
1901
+ // with the overload's return type.
1902
+ _validateOverloadImplementation(overload, implementation, diag) {
1903
+ var _a, _b, _c, _d, _e;
1904
+ const constraints = new constraintTracker_1.ConstraintTracker();
1905
+ let implBound = implementation;
1906
+ let overloadBound = overload;
1907
+ const implNode = (_b = (_a = implementation.shared.declaration) === null || _a === void 0 ? void 0 : _a.node) === null || _b === void 0 ? void 0 : _b.parent;
1908
+ if (implNode) {
1909
+ const liveScopeIds = ParseTreeUtils.getTypeVarScopesForNode(implNode);
1910
+ implBound = (0, typeUtils_1.makeTypeVarsBound)(implementation, liveScopeIds);
1911
+ }
1912
+ const overloadNode = (_c = overload.shared.declaration) === null || _c === void 0 ? void 0 : _c.node;
1913
+ if (overloadNode) {
1914
+ const liveScopeIds = ParseTreeUtils.getTypeVarScopesForNode(overloadNode);
1915
+ overloadBound = (0, typeUtils_1.makeTypeVarsBound)(overload, liveScopeIds);
1916
+ }
1857
1917
  // First check the parameters to see if they are assignable.
1858
- let isLegal = this._evaluator.assignType(overload, implementation, diag, overloadTypeVarContext, implTypeVarContext, 64 /* AssignTypeFlags.SkipReturnTypeCheck */ |
1859
- 2 /* AssignTypeFlags.ReverseTypeVarMatching */ |
1860
- 512 /* AssignTypeFlags.SkipSelfClsTypeCheck */);
1918
+ let isConsistent = this._evaluator.assignType(overloadBound, implBound, diag, constraints, 64 /* AssignTypeFlags.SkipReturnTypeCheck */ | 2 /* AssignTypeFlags.Contravariant */ | 512 /* AssignTypeFlags.SkipSelfClsTypeCheck */);
1861
1919
  // Now check the return types.
1862
- const overloadReturnType = (_a = overload.shared.declaredReturnType) !== null && _a !== void 0 ? _a : this._evaluator.getFunctionInferredReturnType(overload);
1863
- const implementationReturnType = (0, typeUtils_1.applySolvedTypeVars)(implementation.shared.declaredReturnType || this._evaluator.getFunctionInferredReturnType(implementation), implTypeVarContext);
1920
+ const overloadReturnType = this._evaluator.solveAndApplyConstraints((_d = types_1.FunctionType.getEffectiveReturnType(overloadBound)) !== null && _d !== void 0 ? _d : this._evaluator.getFunctionInferredReturnType(overloadBound), constraints);
1921
+ const implReturnType = this._evaluator.solveAndApplyConstraints((_e = types_1.FunctionType.getEffectiveReturnType(implBound)) !== null && _e !== void 0 ? _e : this._evaluator.getFunctionInferredReturnType(implBound), constraints);
1864
1922
  const returnDiag = new diagnostic_1.DiagnosticAddendum();
1865
1923
  if (!(0, types_1.isNever)(overloadReturnType) &&
1866
- !this._evaluator.assignType(implementationReturnType, overloadReturnType, returnDiag.createAddendum(), implTypeVarContext, overloadTypeVarContext, 8 /* AssignTypeFlags.SkipSolveTypeVars */)) {
1924
+ !this._evaluator.assignType(implReturnType, overloadReturnType, returnDiag.createAddendum(), constraints, 0 /* AssignTypeFlags.Default */)) {
1867
1925
  returnDiag.addMessage(localize_1.LocAddendum.functionReturnTypeMismatch().format({
1868
1926
  sourceType: this._evaluator.printType(overloadReturnType),
1869
- destType: this._evaluator.printType(implementationReturnType),
1927
+ destType: this._evaluator.printType(implReturnType),
1870
1928
  }));
1871
1929
  diag === null || diag === void 0 ? void 0 : diag.addAddendum(returnDiag);
1872
- isLegal = false;
1930
+ isConsistent = false;
1873
1931
  }
1874
- return isLegal;
1932
+ return isConsistent;
1875
1933
  }
1876
1934
  _walkStatementsAndReportUnreachable(statements) {
1877
1935
  let reportedUnreachable = false;
@@ -2091,16 +2149,16 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
2091
2149
  return;
2092
2150
  }
2093
2151
  const type = this._evaluator.getEffectiveTypeOfSymbol(symbol);
2094
- const overloadedFunctions = (0, types_1.isOverloadedFunction)(type)
2095
- ? types_1.OverloadedFunctionType.getOverloads(type)
2152
+ const overloads = (0, types_1.isOverloaded)(type)
2153
+ ? types_1.OverloadedType.getOverloads(type)
2096
2154
  : (0, types_1.isFunction)(type) && types_1.FunctionType.isOverloaded(type)
2097
2155
  ? [type]
2098
2156
  : [];
2099
2157
  // If the implementation has no name, it was synthesized probably by a
2100
2158
  // decorator that used a callable with a ParamSpec that captured the
2101
2159
  // overloaded signature. We'll exempt it from this check.
2102
- if ((0, types_1.isOverloadedFunction)(type)) {
2103
- const overloads = types_1.OverloadedFunctionType.getOverloads(type);
2160
+ if ((0, types_1.isOverloaded)(type)) {
2161
+ const overloads = types_1.OverloadedType.getOverloads(type);
2104
2162
  if (overloads.length > 0 && overloads[0].shared.name === '') {
2105
2163
  return;
2106
2164
  }
@@ -2110,23 +2168,23 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
2110
2168
  return;
2111
2169
  }
2112
2170
  }
2113
- if (overloadedFunctions.length === 1) {
2171
+ if (overloads.length === 1) {
2114
2172
  // There should never be a single overload.
2115
2173
  this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.singleOverload().format({ name }), primaryDecl.node.d.name);
2116
2174
  }
2117
2175
  // If the file is not a stub and this is the first overload,
2118
2176
  // verify that there is an implementation.
2119
- if (this._fileInfo.isStubFile || overloadedFunctions.length === 0) {
2177
+ if (this._fileInfo.isStubFile || overloads.length === 0) {
2120
2178
  return;
2121
2179
  }
2122
- let implementationFunction;
2123
- if ((0, types_1.isOverloadedFunction)(type)) {
2124
- implementationFunction = types_1.OverloadedFunctionType.getImplementation(type);
2180
+ let implementation;
2181
+ if ((0, types_1.isOverloaded)(type)) {
2182
+ implementation = types_1.OverloadedType.getImplementation(type);
2125
2183
  }
2126
2184
  else if ((0, types_1.isFunction)(type) && !types_1.FunctionType.isOverloaded(type)) {
2127
- implementationFunction = type;
2185
+ implementation = type;
2128
2186
  }
2129
- if (!implementationFunction) {
2187
+ if (!implementation) {
2130
2188
  const containingClassNode = ParseTreeUtils.getEnclosingClassOrFunction(primaryDecl.node);
2131
2189
  if (containingClassNode && containingClassNode.nodeType === 10 /* ParseNodeType.Class */) {
2132
2190
  const classType = this._evaluator.getTypeOfClass(containingClassNode);
@@ -2135,8 +2193,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
2135
2193
  return;
2136
2194
  }
2137
2195
  if (types_1.ClassType.supportsAbstractMethods(classType.classType)) {
2138
- if ((0, types_1.isOverloadedFunction)(type) &&
2139
- types_1.OverloadedFunctionType.getOverloads(type).every((overload) => types_1.FunctionType.isAbstractMethod(overload))) {
2196
+ if ((0, types_1.isOverloaded)(type) &&
2197
+ types_1.OverloadedType.getOverloads(type).every((overload) => types_1.FunctionType.isAbstractMethod(overload))) {
2140
2198
  return;
2141
2199
  }
2142
2200
  }
@@ -2149,19 +2207,24 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
2149
2207
  }), primaryDecl.node.d.name);
2150
2208
  return;
2151
2209
  }
2152
- if (!(0, types_1.isOverloadedFunction)(type)) {
2210
+ if (!(0, types_1.isOverloaded)(type)) {
2211
+ return;
2212
+ }
2213
+ if (this._fileInfo.diagnosticRuleSet.reportInconsistentOverload === 'none') {
2153
2214
  return;
2154
2215
  }
2155
2216
  // Verify that all overload signatures are assignable to implementation signature.
2156
- types_1.OverloadedFunctionType.getOverloads(type).forEach((overload, index) => {
2217
+ types_1.OverloadedType.getOverloads(type).forEach((overload, index) => {
2157
2218
  var _a, _b, _c, _d;
2158
2219
  const diag = new diagnostic_1.DiagnosticAddendum();
2159
- if (!this._isLegalOverloadImplementation(overload, implementationFunction, diag)) {
2160
- if (implementationFunction.shared.declaration) {
2220
+ if (implementation &&
2221
+ (0, types_1.isFunction)(implementation) &&
2222
+ !this._validateOverloadImplementation(overload, implementation, diag)) {
2223
+ if (implementation.shared.declaration) {
2161
2224
  const diagnostic = this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadImplementationMismatch().format({
2162
2225
  name,
2163
2226
  index: index + 1,
2164
- }) + diag.getString(), implementationFunction.shared.declaration.node.d.name);
2227
+ }) + diag.getString(), implementation.shared.declaration.node.d.name);
2165
2228
  if (diagnostic && overload.shared.declaration) {
2166
2229
  diagnostic.addRelatedInfo(localize_1.LocAddendum.overloadSignature(), (_b = (_a = overload.shared.declaration) === null || _a === void 0 ? void 0 : _a.uri) !== null && _b !== void 0 ? _b : primaryDecl.uri, (_d = (_c = overload.shared.declaration) === null || _c === void 0 ? void 0 : _c.range) !== null && _d !== void 0 ? _d : primaryDecl.range);
2167
2230
  }
@@ -2994,6 +3057,16 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
2994
3057
  this._reportDeprecatedDiagnostic(node, errorMessage, info.deprecatedMessage);
2995
3058
  }
2996
3059
  }
3060
+ _reportDeprecatedUseForOperation(node, typeResult) {
3061
+ const deprecationInfo = typeResult === null || typeResult === void 0 ? void 0 : typeResult.magicMethodDeprecationInfo;
3062
+ if (!deprecationInfo) {
3063
+ return;
3064
+ }
3065
+ this._reportDeprecatedDiagnostic(node, localize_1.LocMessage.deprecatedMethod().format({
3066
+ className: deprecationInfo.className,
3067
+ name: deprecationInfo.methodName,
3068
+ }), deprecationInfo.deprecatedMessage);
3069
+ }
2997
3070
  _reportDeprecatedUseForType(node, type, isImportFromTyping = false) {
2998
3071
  var _a, _b, _c;
2999
3072
  if (!type) {
@@ -3042,7 +3115,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3042
3115
  deprecatedMessage = overload.shared.deprecatedMessage;
3043
3116
  errorMessage = getDeprecatedMessageForFunction(overload);
3044
3117
  }
3045
- else if ((0, types_1.isInstantiableClass)(type) && overload.shared.name === '__init__') {
3118
+ else if ((0, types_1.isInstantiableClass)(type) &&
3119
+ ['__init__', '__new__'].includes(overload.shared.name)) {
3046
3120
  deprecatedMessage = overload.shared.deprecatedMessage;
3047
3121
  errorMessage = localize_1.LocMessage.deprecatedConstructor().format({
3048
3122
  name: type.shared.name,
@@ -3080,7 +3154,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3080
3154
  }
3081
3155
  }
3082
3156
  }
3083
- else if ((0, types_1.isOverloadedFunction)(subtype)) {
3157
+ else if ((0, types_1.isOverloaded)(subtype)) {
3084
3158
  // Determine if the node is part of a call expression. If so,
3085
3159
  // we can determine which overload(s) were used to satisfy
3086
3160
  // the call expression and determine whether any of them
@@ -3088,11 +3162,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3088
3162
  getDeprecatedMessageForOverloadedCall(this._evaluator, subtype);
3089
3163
  // If there the implementation itself is deprecated, assume it
3090
3164
  // is deprecated even if it's outside of a call expression.
3091
- const overloadImpl = types_1.OverloadedFunctionType.getImplementation(subtype);
3092
- if ((overloadImpl === null || overloadImpl === void 0 ? void 0 : overloadImpl.shared.deprecatedMessage) !== undefined) {
3093
- if (!overloadImpl.shared.name || node.d.value === overloadImpl.shared.name) {
3094
- deprecatedMessage = overloadImpl.shared.deprecatedMessage;
3095
- errorMessage = getDeprecatedMessageForFunction(overloadImpl);
3165
+ const impl = types_1.OverloadedType.getImplementation(subtype);
3166
+ if (impl && (0, types_1.isFunction)(impl) && impl.shared.deprecatedMessage !== undefined) {
3167
+ if (!impl.shared.name || node.d.value === impl.shared.name) {
3168
+ deprecatedMessage = impl.shared.deprecatedMessage;
3169
+ errorMessage = getDeprecatedMessageForFunction(impl);
3096
3170
  }
3097
3171
  }
3098
3172
  }
@@ -3390,13 +3464,14 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3390
3464
  this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typeGuardParamCount(), node.d.name);
3391
3465
  }
3392
3466
  if (isTypeIs) {
3393
- const typeGuardType = returnType.priv.typeArgs[0];
3467
+ const scopeIds = (0, typeUtils_1.getTypeVarScopeIds)(functionType);
3468
+ const typeGuardType = (0, typeUtils_1.makeTypeVarsBound)(returnType.priv.typeArgs[0], scopeIds);
3394
3469
  // Determine the type of the first parameter.
3395
3470
  const paramIndex = isMethod && !types_1.FunctionType.isStaticMethod(functionType) ? 1 : 0;
3396
3471
  if (paramIndex >= functionType.shared.parameters.length) {
3397
3472
  return;
3398
3473
  }
3399
- const paramType = types_1.FunctionType.getEffectiveParamType(functionType, paramIndex);
3474
+ const paramType = (0, typeUtils_1.makeTypeVarsBound)(types_1.FunctionType.getParamType(functionType, paramIndex), scopeIds);
3400
3475
  // Verify that the typeGuardType is a narrower type than the paramType.
3401
3476
  if (!this._evaluator.assignType(paramType, typeGuardType)) {
3402
3477
  const returnAnnotation = node.d.returnAnnotation || ((_a = node.d.funcAnnotationComment) === null || _a === void 0 ? void 0 : _a.d.returnAnnotation);
@@ -3446,6 +3521,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3446
3521
  if (declaredReturnType) {
3447
3522
  this._reportUnknownReturnResult(node, declaredReturnType);
3448
3523
  this._validateReturnTypeIsNotContravariant(declaredReturnType, returnAnnotation);
3524
+ const liveScopes = ParseTreeUtils.getTypeVarScopesForNode(node);
3525
+ declaredReturnType = (0, typeUtils_1.makeTypeVarsBound)(declaredReturnType, liveScopes);
3449
3526
  }
3450
3527
  // Wrap the declared type in a generator type if the function is a generator.
3451
3528
  if (types_1.FunctionType.isGenerator(functionType)) {
@@ -3466,18 +3543,19 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3466
3543
  }
3467
3544
  }
3468
3545
  else if (!types_1.FunctionType.isAbstractMethod(functionType)) {
3546
+ // If the function consists entirely of "...", assume that it's
3547
+ // an abstract method or a protocol method and don't require that
3548
+ // the return type matches. This check can also be skipped for an overload.
3549
+ const isEmptySuite = ParseTreeUtils.isSuiteEmpty(node.d.suite) || types_1.FunctionType.isOverloaded(functionType);
3469
3550
  // Make sure that the function doesn't implicitly return None if the declared
3470
3551
  // type doesn't allow it. Skip this check for abstract methods.
3471
- const diagAddendum = new diagnostic_1.DiagnosticAddendum();
3552
+ const diagAddendum = isEmptySuite ? undefined : new diagnostic_1.DiagnosticAddendum();
3472
3553
  // If the declared type isn't compatible with 'None', flag an error.
3473
3554
  if (!this._evaluator.assignType(declaredReturnType, this._evaluator.getNoneType(), diagAddendum)) {
3474
- // If the function consists entirely of "...", assume that it's
3475
- // an abstract method or a protocol method and don't require that
3476
- // the return type matches. This check can also be skipped for an overload.
3477
- if (!ParseTreeUtils.isSuiteEmpty(node.d.suite) && !types_1.FunctionType.isOverloaded(functionType)) {
3555
+ if (!isEmptySuite) {
3478
3556
  this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportReturnType, localize_1.LocMessage.returnMissing().format({
3479
3557
  returnType: this._evaluator.printType(declaredReturnType),
3480
- }) + diagAddendum.getString(), returnAnnotation);
3558
+ }) + (diagAddendum === null || diagAddendum === void 0 ? void 0 : diagAddendum.getString()), returnAnnotation);
3481
3559
  }
3482
3560
  }
3483
3561
  }
@@ -3623,13 +3701,13 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3623
3701
  ];
3624
3702
  if (newMemberTypeResult) {
3625
3703
  this._evaluator.validateCallArgs(errorNode, argList, newMemberTypeResult,
3626
- /* typeVarContext */ undefined,
3704
+ /* constraints */ undefined,
3627
3705
  /* skipUnknownArgCheck */ undefined,
3628
3706
  /* inferenceContext */ undefined);
3629
3707
  }
3630
3708
  if (initMemberTypeResult) {
3631
3709
  this._evaluator.validateCallArgs(errorNode, argList, initMemberTypeResult,
3632
- /* typeVarContext */ undefined,
3710
+ /* constraints */ undefined,
3633
3711
  /* skipUnknownArgCheck */ undefined,
3634
3712
  /* inferenceContext */ undefined);
3635
3713
  }
@@ -3688,7 +3766,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3688
3766
  return;
3689
3767
  }
3690
3768
  // Verify that the parameter count matches.
3691
- const nonDefaultParams = paramListDetails.params.filter((paramInfo) => !paramInfo.param.defaultType);
3769
+ const nonDefaultParams = paramListDetails.params.filter((paramInfo, index) => types_1.FunctionType.getParamDefaultType(postInitType, index) === undefined);
3692
3770
  // We expect to see one param for "self" plus one for each of the InitVars.
3693
3771
  const expectedParamCount = initOnlySymbolMap.size + 1;
3694
3772
  const postInitNode = postInitType.shared.declaration.node;
@@ -3707,7 +3785,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3707
3785
  const annotationNode = (_a = paramNode === null || paramNode === void 0 ? void 0 : paramNode.d.annotation) !== null && _a !== void 0 ? _a : paramNode === null || paramNode === void 0 ? void 0 : paramNode.d.annotationComment;
3708
3786
  if (types_1.FunctionParam.isTypeDeclared(param) && annotationNode) {
3709
3787
  const fieldType = (_b = this._evaluator.getDeclaredTypeOfSymbol(symbol)) === null || _b === void 0 ? void 0 : _b.type;
3710
- const paramType = types_1.FunctionType.getEffectiveParamType(postInitType, paramListDetails.params[paramIndex].index);
3788
+ const paramType = types_1.FunctionType.getParamType(postInitType, paramListDetails.params[paramIndex].index);
3711
3789
  const assignTypeDiag = new diagnostic_1.DiagnosticAddendum();
3712
3790
  if (fieldType && !this._evaluator.assignType(paramType, fieldType, assignTypeDiag)) {
3713
3791
  const diagnostic = this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.dataClassPostInitType().format({ fieldName }) + assignTypeDiag.getString(), annotationNode);
@@ -3890,7 +3968,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
3890
3968
  const objectObject = types_1.ClassType.cloneAsInstance(objectType);
3891
3969
  const dummyTypeObject = types_1.ClassType.createInstantiable('__varianceDummy', '', '', uri_1.Uri.empty(), 0, 0, undefined, undefined);
3892
3970
  classType.shared.typeParams.forEach((param, paramIndex) => {
3893
- // Skip variadics and ParamSpecs.
3971
+ // Skip TypeVarTuples and ParamSpecs.
3894
3972
  if ((0, types_1.isTypeVarTuple)(param) || (0, types_1.isParamSpec)(param)) {
3895
3973
  return;
3896
3974
  }
@@ -4007,24 +4085,24 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4007
4085
  return;
4008
4086
  }
4009
4087
  let newMemberType = newMethodResult.type;
4010
- if (!(0, types_1.isFunction)(newMemberType) && !(0, types_1.isOverloadedFunction)(newMemberType)) {
4088
+ if (!(0, types_1.isFunction)(newMemberType) && !(0, types_1.isOverloaded)(newMemberType)) {
4011
4089
  return;
4012
4090
  }
4013
- if ((0, types_1.isOverloadedFunction)(newMemberType)) {
4091
+ if ((0, types_1.isOverloaded)(newMemberType)) {
4014
4092
  // Find the implementation, not the overloaded signatures.
4015
- newMemberType = types_1.OverloadedFunctionType.getImplementation(newMemberType);
4016
- if (!newMemberType) {
4093
+ newMemberType = types_1.OverloadedType.getImplementation(newMemberType);
4094
+ if (!newMemberType || !(0, types_1.isFunction)(newMemberType)) {
4017
4095
  return;
4018
4096
  }
4019
4097
  }
4020
4098
  let initMemberType = initMethodResult.type;
4021
- if (!(0, types_1.isFunction)(initMemberType) && !(0, types_1.isOverloadedFunction)(initMemberType)) {
4099
+ if (!(0, types_1.isFunction)(initMemberType) && !(0, types_1.isOverloaded)(initMemberType)) {
4022
4100
  return;
4023
4101
  }
4024
- if ((0, types_1.isOverloadedFunction)(initMemberType)) {
4102
+ if ((0, types_1.isOverloaded)(initMemberType)) {
4025
4103
  // Find the implementation, not the overloaded signatures.
4026
- initMemberType = types_1.OverloadedFunctionType.getImplementation(initMemberType);
4027
- if (!initMemberType) {
4104
+ initMemberType = types_1.OverloadedType.getImplementation(initMemberType);
4105
+ if (!initMemberType || !(0, types_1.isFunction)(initMemberType)) {
4028
4106
  return;
4029
4107
  }
4030
4108
  }
@@ -4035,12 +4113,10 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4035
4113
  }
4036
4114
  if (!this._evaluator.assignType(newMemberType, initMemberType,
4037
4115
  /* diag */ undefined,
4038
- /* destTypeVarContext */ undefined,
4039
- /* srcTypeVarContext */ undefined, 64 /* AssignTypeFlags.SkipReturnTypeCheck */) ||
4116
+ /* constraints */ undefined, 64 /* AssignTypeFlags.SkipReturnTypeCheck */) ||
4040
4117
  !this._evaluator.assignType(initMemberType, newMemberType,
4041
4118
  /* diag */ undefined,
4042
- /* destTypeVarContext */ undefined,
4043
- /* srcTypeVarContext */ undefined, 64 /* AssignTypeFlags.SkipReturnTypeCheck */)) {
4119
+ /* constraints */ undefined, 64 /* AssignTypeFlags.SkipReturnTypeCheck */)) {
4044
4120
  const displayOnInit = types_1.ClassType.isSameGenericClass(initMethodResult.classType, classType);
4045
4121
  const initDecl = initMemberType.shared.declaration;
4046
4122
  const newDecl = newMemberType.shared.declaration;
@@ -4087,16 +4163,17 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4087
4163
  }
4088
4164
  const diagAddendum = new diagnostic_1.DiagnosticAddendum();
4089
4165
  for (const baseClass of filteredBaseClasses) {
4090
- const typeVarContext = (0, typeUtils_1.buildTypeVarContextFromSpecializedClass)(baseClass);
4166
+ const solution = (0, typeUtils_1.buildSolutionFromSpecializedClass)(baseClass);
4091
4167
  for (const baseClassMroClass of baseClass.shared.mro) {
4092
4168
  // There's no need to check for conflicts if this class isn't generic.
4093
4169
  if ((0, types_1.isClass)(baseClassMroClass) && baseClassMroClass.shared.typeParams.length > 0) {
4094
- const specializedBaseClassMroClass = (0, typeUtils_1.applySolvedTypeVars)(baseClassMroClass, typeVarContext);
4170
+ const specializedBaseClassMroClass = (0, typeUtils_1.applySolvedTypeVars)(baseClassMroClass, solution);
4095
4171
  // Find the corresponding class in the derived class's MRO list.
4096
4172
  const matchingMroClass = classType.shared.mro.find((mroClass) => (0, types_1.isClass)(mroClass) && types_1.ClassType.isSameGenericClass(mroClass, specializedBaseClassMroClass));
4097
4173
  if (matchingMroClass && (0, types_1.isInstantiableClass)(matchingMroClass)) {
4098
- const matchingMroObject = types_1.ClassType.cloneAsInstance(matchingMroClass);
4099
- const baseClassMroObject = types_1.ClassType.cloneAsInstance(specializedBaseClassMroClass);
4174
+ const scopeIds = (0, typeUtils_1.getTypeVarScopeIds)(classType);
4175
+ const matchingMroObject = (0, typeUtils_1.makeTypeVarsBound)(types_1.ClassType.cloneAsInstance(matchingMroClass), scopeIds);
4176
+ const baseClassMroObject = (0, typeUtils_1.makeTypeVarsBound)(types_1.ClassType.cloneAsInstance(specializedBaseClassMroClass), scopeIds);
4100
4177
  if (!this._evaluator.assignType(matchingMroObject, baseClassMroObject)) {
4101
4178
  const diag = new diagnostic_1.DiagnosticAddendum();
4102
4179
  const baseClassObject = (0, typeUtils_1.convertToInstance)(baseClass);
@@ -4208,19 +4285,20 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4208
4285
  let diag;
4209
4286
  const overrideDecl = (0, symbolUtils_1.getLastTypedDeclarationForSymbol)(overrideClassAndSymbol.symbol);
4210
4287
  const overriddenDecl = (0, symbolUtils_1.getLastTypedDeclarationForSymbol)(overriddenClassAndSymbol.symbol);
4211
- if ((0, types_1.isFunction)(overriddenType) || (0, types_1.isOverloadedFunction)(overriddenType)) {
4288
+ if ((0, types_1.isFunction)(overriddenType) || (0, types_1.isOverloaded)(overriddenType)) {
4212
4289
  const diagAddendum = new diagnostic_1.DiagnosticAddendum();
4213
4290
  let overrideFunction;
4214
4291
  if ((0, types_1.isFunction)(overrideType)) {
4215
4292
  overrideFunction = overrideType;
4216
4293
  }
4217
- else if ((0, types_1.isOverloadedFunction)(overrideType)) {
4294
+ else if ((0, types_1.isOverloaded)(overrideType)) {
4218
4295
  // Use the last overload.
4219
- overrideFunction = types_1.OverloadedFunctionType.getImplementation(overrideType);
4296
+ const impl = types_1.OverloadedType.getImplementation(overrideType);
4220
4297
  // If the last overload isn't an implementation, skip the check for this symbol.
4221
- if (!overrideFunction) {
4298
+ if (!impl || !(0, types_1.isFunction)(impl)) {
4222
4299
  return;
4223
4300
  }
4301
+ overrideFunction = impl;
4224
4302
  }
4225
4303
  if (overrideFunction) {
4226
4304
  if (!this._evaluator.validateOverrideMethod(overriddenType, overrideFunction,
@@ -4281,8 +4359,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4281
4359
  }
4282
4360
  if (!this._evaluator.assignType(overriddenType, childOverrideType !== null && childOverrideType !== void 0 ? childOverrideType : overrideType,
4283
4361
  /* diag */ undefined,
4284
- /* destTypeVarContext */ undefined,
4285
- /* srcTypeVarContext */ undefined, isInvariant ? 1 /* AssignTypeFlags.EnforceInvariance */ : 0 /* AssignTypeFlags.Default */)) {
4362
+ /* constraints */ undefined, isInvariant ? 1 /* AssignTypeFlags.Invariant */ : 0 /* AssignTypeFlags.Default */)) {
4286
4363
  diag = this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportIncompatibleVariableOverride, localize_1.LocMessage.baseClassVariableTypeIncompatible().format({
4287
4364
  classType: childClassType.shared.name,
4288
4365
  name: memberName,
@@ -4396,40 +4473,78 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4396
4473
  return;
4397
4474
  }
4398
4475
  const typeOfSymbol = this._evaluator.getEffectiveTypeOfSymbol(symbol);
4399
- if (!(0, types_1.isOverloadedFunction)(typeOfSymbol)) {
4476
+ if (!(0, types_1.isOverloaded)(typeOfSymbol)) {
4400
4477
  return;
4401
4478
  }
4402
- const overloads = types_1.OverloadedFunctionType.getOverloads(typeOfSymbol);
4403
- // If there's an implementation, it will determine whether the
4404
- // function is @final.
4405
- const implementation = types_1.OverloadedFunctionType.getImplementation(typeOfSymbol);
4406
- if (implementation) {
4407
- // If one or more of the overloads is marked @final but the
4408
- // implementation is not, report an error.
4409
- if (!types_1.FunctionType.isFinal(implementation)) {
4410
- overloads.forEach((overload) => {
4411
- var _a, _b;
4412
- if (types_1.FunctionType.isFinal(overload) && ((_a = overload.shared.declaration) === null || _a === void 0 ? void 0 : _a.node)) {
4413
- this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadFinalInconsistencyImpl().format({
4414
- name: overload.shared.name,
4415
- }), (_b = (0, declarationUtils_1.getNameNodeForDeclaration)(overload.shared.declaration)) !== null && _b !== void 0 ? _b : overload.shared.declaration.node);
4416
- }
4417
- });
4418
- }
4479
+ const overloads = types_1.OverloadedType.getOverloads(typeOfSymbol);
4480
+ const implementation = types_1.OverloadedType.getImplementation(typeOfSymbol);
4481
+ this._validateOverloadFinalConsistency(overloads, implementation);
4482
+ this._validateOverloadAbstractConsistency(overloads, implementation);
4483
+ });
4484
+ }
4485
+ _validateOverloadAbstractConsistency(overloads, implementation) {
4486
+ // If there's an implementation, it will determine whether the
4487
+ // function is abstract.
4488
+ if (implementation && (0, types_1.isFunction)(implementation)) {
4489
+ const isImplAbstract = types_1.FunctionType.isAbstractMethod(implementation);
4490
+ if (isImplAbstract) {
4419
4491
  return;
4420
4492
  }
4421
- if (!types_1.FunctionType.isFinal(overloads[0])) {
4422
- overloads.slice(1).forEach((overload, index) => {
4493
+ overloads.forEach((overload) => {
4494
+ var _a;
4495
+ const decl = overload.shared.declaration;
4496
+ if (types_1.FunctionType.isAbstractMethod(overload) && decl) {
4497
+ this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadAbstractImplMismatch().format({
4498
+ name: overload.shared.name,
4499
+ }), (_a = (0, declarationUtils_1.getNameNodeForDeclaration)(decl)) !== null && _a !== void 0 ? _a : decl.node);
4500
+ }
4501
+ });
4502
+ return;
4503
+ }
4504
+ if (overloads.length < 2) {
4505
+ return;
4506
+ }
4507
+ // If there was no implementation, make sure all overloads are either
4508
+ // abstract or not abstract.
4509
+ const isFirstOverloadAbstract = types_1.FunctionType.isAbstractMethod(overloads[0]);
4510
+ overloads.slice(1).forEach((overload, index) => {
4511
+ var _a;
4512
+ if (types_1.FunctionType.isAbstractMethod(overload) !== isFirstOverloadAbstract && overload.shared.declaration) {
4513
+ this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadAbstractMismatch().format({
4514
+ name: overload.shared.name,
4515
+ }), (_a = (0, declarationUtils_1.getNameNodeForDeclaration)(overload.shared.declaration)) !== null && _a !== void 0 ? _a : overload.shared.declaration.node);
4516
+ }
4517
+ });
4518
+ }
4519
+ _validateOverloadFinalConsistency(overloads, implementation) {
4520
+ // If there's an implementation, it will determine whether the
4521
+ // function is @final.
4522
+ if (implementation && (0, types_1.isFunction)(implementation)) {
4523
+ // If one or more of the overloads is marked @final but the
4524
+ // implementation is not, report an error.
4525
+ if (!types_1.FunctionType.isFinal(implementation)) {
4526
+ overloads.forEach((overload) => {
4423
4527
  var _a, _b;
4424
4528
  if (types_1.FunctionType.isFinal(overload) && ((_a = overload.shared.declaration) === null || _a === void 0 ? void 0 : _a.node)) {
4425
- this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadFinalInconsistencyNoImpl().format({
4529
+ this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadFinalInconsistencyImpl().format({
4426
4530
  name: overload.shared.name,
4427
- index: index + 2,
4428
4531
  }), (_b = (0, declarationUtils_1.getNameNodeForDeclaration)(overload.shared.declaration)) !== null && _b !== void 0 ? _b : overload.shared.declaration.node);
4429
4532
  }
4430
4533
  });
4431
4534
  }
4432
- });
4535
+ return;
4536
+ }
4537
+ if (overloads.length > 0 && !types_1.FunctionType.isFinal(overloads[0])) {
4538
+ overloads.slice(1).forEach((overload, index) => {
4539
+ var _a, _b;
4540
+ if (types_1.FunctionType.isFinal(overload) && ((_a = overload.shared.declaration) === null || _a === void 0 ? void 0 : _a.node)) {
4541
+ this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadFinalInconsistencyNoImpl().format({
4542
+ name: overload.shared.name,
4543
+ index: index + 2,
4544
+ }), (_b = (0, declarationUtils_1.getNameNodeForDeclaration)(overload.shared.declaration)) !== null && _b !== void 0 ? _b : overload.shared.declaration.node);
4545
+ }
4546
+ });
4547
+ }
4433
4548
  }
4434
4549
  // For a TypedDict class that derives from another TypedDict class
4435
4550
  // that is closed, verify that any new keys are compatible with the
@@ -4448,9 +4563,9 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4448
4563
  }
4449
4564
  const baseTypedDictEntries = (0, typedDicts_1.getTypedDictMembersForClass)(this._evaluator, baseClass,
4450
4565
  /* allowNarrowed */ false);
4451
- const typeVarContext = (0, typeUtils_1.buildTypeVarContextFromSpecializedClass)(baseClass);
4566
+ const solution = (0, typeUtils_1.buildSolutionFromSpecializedClass)(baseClass);
4452
4567
  const baseExtraItemsType = baseTypedDictEntries.extraItems
4453
- ? (0, typeUtils_1.applySolvedTypeVars)(baseTypedDictEntries.extraItems.valueType, typeVarContext)
4568
+ ? (0, typeUtils_1.applySolvedTypeVars)(baseTypedDictEntries.extraItems.valueType, solution)
4454
4569
  : types_1.UnknownType.create();
4455
4570
  for (const [name, entry] of typedDictEntries.knownItems) {
4456
4571
  const baseEntry = baseTypedDictEntries.knownItems.get(name);
@@ -4462,9 +4577,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4462
4577
  }
4463
4578
  else if (!this._evaluator.assignType(baseExtraItemsType, entry.valueType,
4464
4579
  /* diag */ undefined,
4465
- /* destTypeVarContext */ undefined,
4466
- /* srcTypeVarContext */ undefined, !baseTypedDictEntries.extraItems.isReadOnly
4467
- ? 1 /* AssignTypeFlags.EnforceInvariance */
4580
+ /* constraints */ undefined, !baseTypedDictEntries.extraItems.isReadOnly
4581
+ ? 1 /* AssignTypeFlags.Invariant */
4468
4582
  : 0 /* AssignTypeFlags.Default */)) {
4469
4583
  diag.addMessage(localize_1.LocAddendum.typedDictClosedExtraTypeMismatch().format({
4470
4584
  name,
@@ -4481,9 +4595,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4481
4595
  if (typedDictEntries.extraItems && baseTypedDictEntries.extraItems) {
4482
4596
  if (!this._evaluator.assignType(baseExtraItemsType, typedDictEntries.extraItems.valueType,
4483
4597
  /* diag */ undefined,
4484
- /* destTypeVarContext */ undefined,
4485
- /* srcTypeVarContext */ undefined, !baseTypedDictEntries.extraItems.isReadOnly
4486
- ? 1 /* AssignTypeFlags.EnforceInvariance */
4598
+ /* constraints */ undefined, !baseTypedDictEntries.extraItems.isReadOnly
4599
+ ? 1 /* AssignTypeFlags.Invariant */
4487
4600
  : 0 /* AssignTypeFlags.Default */)) {
4488
4601
  diag.addMessage(localize_1.LocAddendum.typedDictClosedExtraTypeMismatch().format({
4489
4602
  name: '__extra_items__',
@@ -4571,8 +4684,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4571
4684
  if ((0, types_1.isFunction)(overrideType)) {
4572
4685
  overrideFunction = overrideType;
4573
4686
  }
4574
- else if ((0, types_1.isOverloadedFunction)(overrideType)) {
4575
- overrideFunction = types_1.OverloadedFunctionType.getImplementation(overrideType);
4687
+ else if ((0, types_1.isOverloaded)(overrideType)) {
4688
+ const impl = types_1.OverloadedType.getImplementation(overrideType);
4689
+ if (impl && (0, types_1.isFunction)(impl)) {
4690
+ overrideFunction = impl;
4691
+ }
4576
4692
  }
4577
4693
  else if ((0, types_1.isClassInstance)(overrideType) && types_1.ClassType.isPropertyClass(overrideType)) {
4578
4694
  if (overrideType.priv.fgetInfo) {
@@ -4614,8 +4730,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4614
4730
  if ((0, types_1.isFunction)(overrideType)) {
4615
4731
  overrideFunction = overrideType;
4616
4732
  }
4617
- else if ((0, types_1.isOverloadedFunction)(overrideType)) {
4618
- overrideFunction = types_1.OverloadedFunctionType.getImplementation(overrideType);
4733
+ else if ((0, types_1.isOverloaded)(overrideType)) {
4734
+ const impl = types_1.OverloadedType.getImplementation(overrideType);
4735
+ if (impl && (0, types_1.isFunction)(impl)) {
4736
+ overrideFunction = impl;
4737
+ }
4619
4738
  }
4620
4739
  else if ((0, types_1.isClassInstance)(overrideType) && types_1.ClassType.isPropertyClass(overrideType)) {
4621
4740
  if (overrideType.priv.fgetInfo) {
@@ -4654,9 +4773,13 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4654
4773
  }
4655
4774
  const baseClass = baseClassAndSymbol.classType;
4656
4775
  const childClassSelf = types_1.ClassType.cloneAsInstance((0, typeUtils_1.selfSpecializeClass)(childClassType));
4657
- const baseType = (0, typeUtils_1.partiallySpecializeType)(this._evaluator.getEffectiveTypeOfSymbol(baseClassAndSymbol.symbol), baseClass, this._evaluator.getTypeClassType(), childClassSelf);
4776
+ let baseType = (0, typeUtils_1.partiallySpecializeType)(this._evaluator.getEffectiveTypeOfSymbol(baseClassAndSymbol.symbol), baseClass, this._evaluator.getTypeClassType(), childClassSelf);
4658
4777
  overrideType = (0, typeUtils_1.partiallySpecializeType)(overrideType, childClassType, this._evaluator.getTypeClassType(), childClassSelf);
4659
- if ((0, types_1.isFunction)(baseType) || (0, types_1.isOverloadedFunction)(baseType)) {
4778
+ if (childClassType.shared.typeVarScopeId) {
4779
+ baseType = (0, typeUtils_1.makeTypeVarsBound)(baseType, [childClassType.shared.typeVarScopeId]);
4780
+ overrideType = (0, typeUtils_1.makeTypeVarsBound)(overrideType, [childClassType.shared.typeVarScopeId]);
4781
+ }
4782
+ if ((0, types_1.isFunction)(baseType) || (0, types_1.isOverloaded)(baseType)) {
4660
4783
  const diagAddendum = new diagnostic_1.DiagnosticAddendum();
4661
4784
  // Determine whether this is an attempt to override a method marked @final.
4662
4785
  let reportFinalMethodOverride = false;
@@ -4665,9 +4788,15 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4665
4788
  if ((0, types_1.isFunction)(baseType) && types_1.FunctionType.isFinal(baseType)) {
4666
4789
  reportFinalMethodOverride = true;
4667
4790
  }
4668
- else if ((0, types_1.isOverloadedFunction)(baseType) &&
4669
- baseType.priv.overloads.some((overload) => types_1.FunctionType.isFinal(overload))) {
4670
- reportFinalMethodOverride = true;
4791
+ else if ((0, types_1.isOverloaded)(baseType)) {
4792
+ const overloads = types_1.OverloadedType.getOverloads(baseType);
4793
+ const impl = types_1.OverloadedType.getImplementation(baseType);
4794
+ if (overloads.some((overload) => types_1.FunctionType.isFinal(overload))) {
4795
+ reportFinalMethodOverride = true;
4796
+ }
4797
+ if (impl && (0, types_1.isFunction)(impl) && types_1.FunctionType.isFinal(impl)) {
4798
+ reportFinalMethodOverride = true;
4799
+ }
4671
4800
  }
4672
4801
  }
4673
4802
  if (reportFinalMethodOverride) {
@@ -4683,7 +4812,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4683
4812
  }
4684
4813
  }
4685
4814
  }
4686
- if ((0, types_1.isFunction)(overrideType) || (0, types_1.isOverloadedFunction)(overrideType)) {
4815
+ if ((0, types_1.isFunction)(overrideType) || (0, types_1.isOverloaded)(overrideType)) {
4687
4816
  // Don't enforce parameter names for dundered methods. Many of them
4688
4817
  // are misnamed in typeshed stubs, so this would result in many
4689
4818
  // false positives.
@@ -4794,8 +4923,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4794
4923
  }
4795
4924
  let diagAddendum = new diagnostic_1.DiagnosticAddendum();
4796
4925
  if (!this._evaluator.assignType(baseType, overrideType, diagAddendum,
4797
- /* destTypeVarContext */ undefined,
4798
- /* srcTypeVarContext */ undefined, isInvariant ? 1 /* AssignTypeFlags.EnforceInvariance */ : 0 /* AssignTypeFlags.Default */)) {
4926
+ /* constraints */ undefined, isInvariant ? 1 /* AssignTypeFlags.Invariant */ : 0 /* AssignTypeFlags.Default */)) {
4799
4927
  if (isInvariant) {
4800
4928
  diagAddendum = new diagnostic_1.DiagnosticAddendum();
4801
4929
  diagAddendum.addMessage(localize_1.LocAddendum.overrideIsInvariant());
@@ -4949,104 +5077,93 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
4949
5077
  // Performs checks on a function that is located within a class
4950
5078
  // and has been determined not to be a property accessor.
4951
5079
  _validateMethod(node, functionType, classNode) {
4952
- var _a, _b;
4953
5080
  const classTypeInfo = this._evaluator.getTypeOfClass(classNode);
4954
- const classType = classTypeInfo === null || classTypeInfo === void 0 ? void 0 : classTypeInfo.classType;
4955
- if (node.d.name && classType) {
4956
- const superCheckMethods = ['__init__', '__init_subclass__', '__enter__', '__exit__'];
4957
- if (superCheckMethods.some((name) => name === node.d.name.d.value)) {
4958
- if (!types_1.FunctionType.isAbstractMethod(functionType) &&
4959
- !types_1.FunctionType.isOverloaded(functionType) &&
4960
- !this._fileInfo.isStubFile) {
4961
- this._validateSuperCallForMethod(node, functionType, classType);
4962
- }
4963
- }
5081
+ if (!classTypeInfo) {
5082
+ return;
4964
5083
  }
4965
- if (((_a = node.d.name) === null || _a === void 0 ? void 0 : _a.d.value) === '__new__') {
4966
- // __new__ overrides should have a "cls" parameter.
4967
- if (node.d.params.length === 0 ||
4968
- !node.d.params[0].d.name ||
4969
- !['cls', '_cls', '__cls', '__mcls', 'mcls', 'mcs', 'metacls'].some((name) => node.d.params[0].d.name.d.value === name)) {
4970
- this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.newClsParam(), node.d.params.length > 0 ? node.d.params[0] : node.d.name);
4971
- }
4972
- if (classType) {
4973
- this._validateClsSelfParamType(node, functionType, classType, /* isCls */ true);
5084
+ const classType = classTypeInfo.classType;
5085
+ const methodName = node.d.name.d.value;
5086
+ const isMetaclass = (0, typeUtils_1.isInstantiableMetaclass)(classType);
5087
+ const superCheckMethods = ['__init__', '__init_subclass__', '__enter__', '__exit__'];
5088
+ if (superCheckMethods.includes(methodName)) {
5089
+ if (!types_1.FunctionType.isAbstractMethod(functionType) &&
5090
+ !types_1.FunctionType.isOverloaded(functionType) &&
5091
+ !this._fileInfo.isStubFile) {
5092
+ this._validateSuperCallForMethod(node, functionType, classType);
4974
5093
  }
4975
5094
  }
4976
- else if (((_b = node.d.name) === null || _b === void 0 ? void 0 : _b.d.value) === '_generate_next_value_') {
5095
+ const selfNames = ['self', '_self', '__self'];
5096
+ const clsNames = ['cls', '_cls', '__cls'];
5097
+ const clsNamesMetaclass = ['__mcls', 'mcls', 'mcs', 'metacls'];
5098
+ if (methodName === '_generate_next_value_') {
4977
5099
  // Skip this check for _generate_next_value_.
5100
+ return;
4978
5101
  }
4979
- else if (types_1.FunctionType.isStaticMethod(functionType)) {
4980
- // Static methods should not have "self" or "cls" parameters.
4981
- if (node.d.params.length > 0 && node.d.params[0].d.name) {
5102
+ if (methodName === '__new__') {
5103
+ // __new__ overrides should have a "cls" parameter.
5104
+ if (node.d.params.length === 0 || !node.d.params[0].d.name) {
5105
+ this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.newClsParam(), node.d.name);
5106
+ }
5107
+ else {
4982
5108
  const paramName = node.d.params[0].d.name.d.value;
4983
- if (paramName === 'self' || paramName === 'cls') {
4984
- this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.staticClsSelfParam(), node.d.params[0].d.name);
5109
+ if (!clsNames.includes(paramName) && !(isMetaclass && clsNamesMetaclass.includes(paramName))) {
5110
+ this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.newClsParam(), node.d.params[0]);
4985
5111
  }
4986
5112
  }
5113
+ this._validateClsSelfParamType(node, functionType, classType, /* isCls */ true);
5114
+ return;
5115
+ }
5116
+ if (types_1.FunctionType.isStaticMethod(functionType)) {
5117
+ if (node.d.params.length === 0 || !node.d.params[0].d.name) {
5118
+ return;
5119
+ }
5120
+ // Static methods should not have "self" or "cls" parameters.
5121
+ const paramName = node.d.params[0].d.name.d.value;
5122
+ if (paramName === 'self' || paramName === 'cls') {
5123
+ this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.staticClsSelfParam(), node.d.params[0].d.name);
5124
+ }
5125
+ return;
4987
5126
  }
4988
- else if (types_1.FunctionType.isClassMethod(functionType)) {
5127
+ if (types_1.FunctionType.isClassMethod(functionType)) {
4989
5128
  let paramName = '';
4990
5129
  if (node.d.params.length > 0 && node.d.params[0].d.name) {
4991
5130
  paramName = node.d.params[0].d.name.d.value;
4992
5131
  }
4993
- // Class methods should have a "cls" parameter. We'll exempt parameter
4994
- // names that start with an underscore since those are used in a few
4995
- // cases in the stdlib pyi files.
4996
- if (paramName !== 'cls') {
4997
- if (!this._fileInfo.isStubFile || (!paramName.startsWith('_') && paramName !== 'metacls')) {
4998
- this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.classMethodClsParam(), node.d.params.length > 0 ? node.d.params[0] : node.d.name);
4999
- }
5000
- }
5001
- if (classType) {
5002
- this._validateClsSelfParamType(node, functionType, classType, /* isCls */ true);
5132
+ // Class methods should have a "cls" parameter.
5133
+ if (!clsNames.includes(paramName) && !(isMetaclass && clsNamesMetaclass.includes(paramName))) {
5134
+ this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.classMethodClsParam(), node.d.params.length > 0 ? node.d.params[0] : node.d.name);
5003
5135
  }
5136
+ this._validateClsSelfParamType(node, functionType, classType, /* isCls */ true);
5137
+ return;
5004
5138
  }
5005
- else {
5006
- const decoratorIsPresent = node.d.decorators.length > 0;
5007
- const isOverloaded = types_1.FunctionType.isOverloaded(functionType);
5008
- // The presence of a decorator can change the behavior, so we need
5009
- // to back off from this check if a decorator is present. An overload
5010
- // is a decorator, but we'll ignore that here.
5011
- if (isOverloaded || !decoratorIsPresent) {
5012
- let paramName = '';
5013
- let firstParamIsSimple = true;
5014
- if (node.d.params.length > 0) {
5015
- if (node.d.params[0].d.name) {
5016
- paramName = node.d.params[0].d.name.d.value;
5017
- }
5018
- if (node.d.params[0].d.category !== 0 /* ParamCategory.Simple */) {
5019
- firstParamIsSimple = false;
5020
- }
5139
+ const decoratorIsPresent = node.d.decorators.length > 0;
5140
+ const isOverloaded = types_1.FunctionType.isOverloaded(functionType);
5141
+ // The presence of a decorator can change the behavior, so we need
5142
+ // to back off from this check if a decorator is present. An overload
5143
+ // is a decorator, but we'll ignore that here.
5144
+ if (isOverloaded || !decoratorIsPresent) {
5145
+ let paramName = '';
5146
+ let firstParamIsSimple = true;
5147
+ if (node.d.params.length > 0) {
5148
+ if (node.d.params[0].d.name) {
5149
+ paramName = node.d.params[0].d.name.d.value;
5021
5150
  }
5022
- // Instance methods should have a "self" parameter.
5023
- if (firstParamIsSimple && paramName !== 'self') {
5024
- // Special-case metaclasses, which can use "cls" or several variants.
5025
- let isLegalMetaclassName = false;
5026
- if (['cls', 'mcls', 'mcs'].some((name) => name === paramName)) {
5027
- const classTypeInfo = this._evaluator.getTypeOfClass(classNode);
5028
- const typeType = this._evaluator.getBuiltInType(classNode, 'type');
5029
- if (typeType &&
5030
- (0, types_1.isInstantiableClass)(typeType) &&
5031
- classTypeInfo &&
5032
- (0, types_1.isInstantiableClass)(classTypeInfo.classType)) {
5033
- if ((0, typeUtils_1.derivesFromClassRecursive)(classTypeInfo.classType, typeType, /* ignoreUnknown */ true)) {
5034
- isLegalMetaclassName = true;
5035
- }
5036
- }
5037
- }
5038
- // Some typeshed stubs use a name that starts with an underscore to designate
5039
- // a parameter that cannot be positional.
5040
- const isPrivateName = SymbolNameUtils.isPrivateOrProtectedName(paramName);
5041
- if (!isLegalMetaclassName && !isPrivateName) {
5042
- this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.instanceMethodSelfParam(), node.d.params.length > 0 ? node.d.params[0] : node.d.name);
5043
- }
5151
+ if (node.d.params[0].d.category !== 0 /* ParamCategory.Simple */) {
5152
+ firstParamIsSimple = false;
5044
5153
  }
5045
5154
  }
5046
- if (classType) {
5047
- this._validateClsSelfParamType(node, functionType, classType, /* isCls */ false);
5155
+ // Instance methods should have a "self" parameter.
5156
+ if (firstParamIsSimple && !selfNames.includes(paramName)) {
5157
+ const isLegalMetaclassName = isMetaclass && clsNames.includes(paramName);
5158
+ // Some typeshed stubs use a name that starts with an underscore to designate
5159
+ // a parameter that cannot be positional.
5160
+ const isPrivateName = SymbolNameUtils.isPrivateOrProtectedName(paramName);
5161
+ if (!isLegalMetaclassName && !isPrivateName) {
5162
+ this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.instanceMethodSelfParam(), node.d.params.length > 0 ? node.d.params[0] : node.d.name);
5163
+ }
5048
5164
  }
5049
5165
  }
5166
+ this._validateClsSelfParamType(node, functionType, classType, /* isCls */ false);
5050
5167
  }
5051
5168
  // Determines whether the method properly calls through to the same method in all
5052
5169
  // parent classes that expose a same-named method.
@@ -5111,6 +5228,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
5111
5228
  // If there is no type annotation, there's nothing to check because
5112
5229
  // the type will be inferred.d.typeAnnotation
5113
5230
  const paramInfo = functionType.shared.parameters[0];
5231
+ const paramType = types_1.FunctionType.getParamType(functionType, 0);
5114
5232
  const paramAnnotation = (_a = node.d.params[0].d.annotation) !== null && _a !== void 0 ? _a : node.d.params[0].d.annotationComment;
5115
5233
  if (!paramAnnotation || !paramInfo.name) {
5116
5234
  return;
@@ -5119,11 +5237,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
5119
5237
  // use of class-scoped TypeVars, which are not allowed in this context
5120
5238
  // according to the typing spec.
5121
5239
  if (functionType.shared.name === '__init__' && functionType.shared.methodClass) {
5122
- const typeVars = (0, typeUtils_1.getTypeVarArgsRecursive)(paramInfo.type);
5240
+ const typeVars = (0, typeUtils_1.getTypeVarArgsRecursive)(paramType);
5123
5241
  if (typeVars.some((typeVar) => {
5124
5242
  var _a;
5125
5243
  return typeVar.priv.scopeId === ((_a = functionType.shared.methodClass) === null || _a === void 0 ? void 0 : _a.shared.typeVarScopeId) &&
5126
- !typeVar.shared.isSynthesizedSelf;
5244
+ !types_1.TypeVarType.isSelf(typeVar);
5127
5245
  })) {
5128
5246
  this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInvalidTypeVarUse, localize_1.LocMessage.initMethodSelfParamTypeVar(), paramAnnotation);
5129
5247
  }
@@ -5133,20 +5251,20 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
5133
5251
  if (types_1.ClassType.isProtocolClass(classType)) {
5134
5252
  return;
5135
5253
  }
5136
- const paramType = this._evaluator.makeTopLevelTypeVarsConcrete(paramInfo.type);
5254
+ const concreteParamType = this._evaluator.makeTopLevelTypeVarsConcrete(paramType);
5137
5255
  const expectedType = isCls ? classType : (0, typeUtils_1.convertToInstance)(classType);
5138
5256
  // If the declared type is a protocol class or instance, skip
5139
5257
  // the check. This has legitimate uses for mix-in classes.
5140
- if ((0, types_1.isInstantiableClass)(paramType) && types_1.ClassType.isProtocolClass(paramType)) {
5258
+ if ((0, types_1.isInstantiableClass)(concreteParamType) && types_1.ClassType.isProtocolClass(concreteParamType)) {
5141
5259
  return;
5142
5260
  }
5143
- if ((0, types_1.isClassInstance)(paramType) && types_1.ClassType.isProtocolClass(paramType)) {
5261
+ if ((0, types_1.isClassInstance)(concreteParamType) && types_1.ClassType.isProtocolClass(concreteParamType)) {
5144
5262
  return;
5145
5263
  }
5146
5264
  // If the method starts with a `*args: P.args`, skip the check.
5147
5265
  if (paramInfo.category === 1 /* ParamCategory.ArgsList */ &&
5148
- (0, types_1.isParamSpec)(paramInfo.type) &&
5149
- paramInfo.type.priv.paramSpecAccess === 'args') {
5266
+ (0, types_1.isParamSpec)(paramType) &&
5267
+ paramType.priv.paramSpecAccess === 'args') {
5150
5268
  return;
5151
5269
  }
5152
5270
  // Don't enforce this for an overloaded method because the "self" param
@@ -5163,8 +5281,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
5163
5281
  types_1.ClassType.isBuiltIn(classType, 'str')) {
5164
5282
  return;
5165
5283
  }
5166
- const typeVarContext = new typeVarContext_1.TypeVarContext((0, typeUtils_1.getTypeVarScopeId)(functionType));
5167
- if (!this._evaluator.assignType(paramType, expectedType, /* diag */ undefined, typeVarContext)) {
5284
+ if (!this._evaluator.assignType(paramType, expectedType)) {
5168
5285
  // We exempt Never from this check because it has a legitimate use in this case.
5169
5286
  if (!(0, types_1.isNever)(paramType)) {
5170
5287
  this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.clsSelfParamTypeMismatch().format({
@@ -5191,7 +5308,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
5191
5308
  return;
5192
5309
  }
5193
5310
  const liveScopes = ParseTreeUtils.getTypeVarScopesForNode(node);
5194
- declaredReturnType = (0, typeUtils_1.updateTypeWithInternalTypeVars)(declaredReturnType, liveScopes);
5311
+ declaredReturnType = (0, typeUtils_1.makeTypeVarsBound)(declaredReturnType, liveScopes);
5195
5312
  let generatorType;
5196
5313
  if (!enclosingFunctionNode.d.isAsync &&
5197
5314
  (0, types_1.isClassInstance)(declaredReturnType) &&