@zzzen/pyright-internal 1.1.254
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.
- package/dist/analyzer/aliasDeclarationUtils.d.ts +9 -0
- package/dist/analyzer/aliasDeclarationUtils.js +128 -0
- package/dist/analyzer/aliasDeclarationUtils.js.map +1 -0
- package/dist/analyzer/analysis.d.ts +18 -0
- package/dist/analyzer/analysis.js +81 -0
- package/dist/analyzer/analysis.js.map +1 -0
- package/dist/analyzer/analyzerFileInfo.d.ts +39 -0
- package/dist/analyzer/analyzerFileInfo.js +17 -0
- package/dist/analyzer/analyzerFileInfo.js.map +1 -0
- package/dist/analyzer/analyzerNodeInfo.d.ts +32 -0
- package/dist/analyzer/analyzerNodeInfo.js +138 -0
- package/dist/analyzer/analyzerNodeInfo.js.map +1 -0
- package/dist/analyzer/backgroundAnalysisProgram.d.ts +54 -0
- package/dist/analyzer/backgroundAnalysisProgram.js +222 -0
- package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -0
- package/dist/analyzer/binder.d.ts +149 -0
- package/dist/analyzer/binder.js +3195 -0
- package/dist/analyzer/binder.js.map +1 -0
- package/dist/analyzer/checker.d.ts +116 -0
- package/dist/analyzer/checker.js +3828 -0
- package/dist/analyzer/checker.js.map +1 -0
- package/dist/analyzer/circularDependency.d.ts +7 -0
- package/dist/analyzer/circularDependency.js +51 -0
- package/dist/analyzer/circularDependency.js.map +1 -0
- package/dist/analyzer/codeFlowEngine.d.ts +21 -0
- package/dist/analyzer/codeFlowEngine.js +1132 -0
- package/dist/analyzer/codeFlowEngine.js.map +1 -0
- package/dist/analyzer/codeFlowTypes.d.ts +82 -0
- package/dist/analyzer/codeFlowTypes.js +134 -0
- package/dist/analyzer/codeFlowTypes.js.map +1 -0
- package/dist/analyzer/codeFlowUtils.d.ts +2 -0
- package/dist/analyzer/codeFlowUtils.js +348 -0
- package/dist/analyzer/codeFlowUtils.js.map +1 -0
- package/dist/analyzer/commentUtils.d.ts +4 -0
- package/dist/analyzer/commentUtils.js +131 -0
- package/dist/analyzer/commentUtils.js.map +1 -0
- package/dist/analyzer/constraintSolver.d.ts +7 -0
- package/dist/analyzer/constraintSolver.js +605 -0
- package/dist/analyzer/constraintSolver.js.map +1 -0
- package/dist/analyzer/constructorTransform.d.ts +4 -0
- package/dist/analyzer/constructorTransform.js +219 -0
- package/dist/analyzer/constructorTransform.js.map +1 -0
- package/dist/analyzer/dataClasses.d.ts +9 -0
- package/dist/analyzer/dataClasses.js +762 -0
- package/dist/analyzer/dataClasses.js.map +1 -0
- package/dist/analyzer/declaration.d.ts +90 -0
- package/dist/analyzer/declaration.js +42 -0
- package/dist/analyzer/declaration.js.map +1 -0
- package/dist/analyzer/declarationUtils.d.ts +12 -0
- package/dist/analyzer/declarationUtils.js +212 -0
- package/dist/analyzer/declarationUtils.js.map +1 -0
- package/dist/analyzer/docStringConversion.d.ts +2 -0
- package/dist/analyzer/docStringConversion.js +699 -0
- package/dist/analyzer/docStringConversion.js.map +1 -0
- package/dist/analyzer/docStringUtils.d.ts +3 -0
- package/dist/analyzer/docStringUtils.js +103 -0
- package/dist/analyzer/docStringUtils.js.map +1 -0
- package/dist/analyzer/functionTransform.d.ts +4 -0
- package/dist/analyzer/functionTransform.js +96 -0
- package/dist/analyzer/functionTransform.js.map +1 -0
- package/dist/analyzer/importResolver.d.ts +97 -0
- package/dist/analyzer/importResolver.js +1617 -0
- package/dist/analyzer/importResolver.js.map +1 -0
- package/dist/analyzer/importResult.d.ts +33 -0
- package/dist/analyzer/importResult.js +11 -0
- package/dist/analyzer/importResult.js.map +1 -0
- package/dist/analyzer/importStatementUtils.d.ts +46 -0
- package/dist/analyzer/importStatementUtils.js +618 -0
- package/dist/analyzer/importStatementUtils.js.map +1 -0
- package/dist/analyzer/namedTuples.d.ts +5 -0
- package/dist/analyzer/namedTuples.js +342 -0
- package/dist/analyzer/namedTuples.js.map +1 -0
- package/dist/analyzer/packageTypeReport.d.ts +52 -0
- package/dist/analyzer/packageTypeReport.js +45 -0
- package/dist/analyzer/packageTypeReport.js.map +1 -0
- package/dist/analyzer/packageTypeVerifier.d.ts +37 -0
- package/dist/analyzer/packageTypeVerifier.js +908 -0
- package/dist/analyzer/packageTypeVerifier.js.map +1 -0
- package/dist/analyzer/parentDirectoryCache.d.ts +23 -0
- package/dist/analyzer/parentDirectoryCache.js +71 -0
- package/dist/analyzer/parentDirectoryCache.js.map +1 -0
- package/dist/analyzer/parseTreeCleaner.d.ts +8 -0
- package/dist/analyzer/parseTreeCleaner.js +51 -0
- package/dist/analyzer/parseTreeCleaner.js.map +1 -0
- package/dist/analyzer/parseTreeUtils.d.ts +98 -0
- package/dist/analyzer/parseTreeUtils.js +1753 -0
- package/dist/analyzer/parseTreeUtils.js.map +1 -0
- package/dist/analyzer/parseTreeWalker.d.ts +81 -0
- package/dist/analyzer/parseTreeWalker.js +437 -0
- package/dist/analyzer/parseTreeWalker.js.map +1 -0
- package/dist/analyzer/patternMatching.d.ts +6 -0
- package/dist/analyzer/patternMatching.js +866 -0
- package/dist/analyzer/patternMatching.js.map +1 -0
- package/dist/analyzer/program.d.ts +158 -0
- package/dist/analyzer/program.js +1902 -0
- package/dist/analyzer/program.js.map +1 -0
- package/dist/analyzer/properties.d.ts +10 -0
- package/dist/analyzer/properties.js +368 -0
- package/dist/analyzer/properties.js.map +1 -0
- package/dist/analyzer/protocols.d.ts +8 -0
- package/dist/analyzer/protocols.js +409 -0
- package/dist/analyzer/protocols.js.map +1 -0
- package/dist/analyzer/pyTypedUtils.d.ts +6 -0
- package/dist/analyzer/pyTypedUtils.js +42 -0
- package/dist/analyzer/pyTypedUtils.js.map +1 -0
- package/dist/analyzer/pythonPathUtils.d.ts +14 -0
- package/dist/analyzer/pythonPathUtils.js +173 -0
- package/dist/analyzer/pythonPathUtils.js.map +1 -0
- package/dist/analyzer/scope.d.ts +39 -0
- package/dist/analyzer/scope.js +110 -0
- package/dist/analyzer/scope.js.map +1 -0
- package/dist/analyzer/scopeUtils.d.ts +6 -0
- package/dist/analyzer/scopeUtils.js +72 -0
- package/dist/analyzer/scopeUtils.js.map +1 -0
- package/dist/analyzer/service.d.ts +144 -0
- package/dist/analyzer/service.js +1197 -0
- package/dist/analyzer/service.js.map +1 -0
- package/dist/analyzer/sourceFile.d.ts +123 -0
- package/dist/analyzer/sourceFile.js +908 -0
- package/dist/analyzer/sourceFile.js.map +1 -0
- package/dist/analyzer/sourceMapper.d.ts +47 -0
- package/dist/analyzer/sourceMapper.js +543 -0
- package/dist/analyzer/sourceMapper.js.map +1 -0
- package/dist/analyzer/staticExpressions.d.ts +4 -0
- package/dist/analyzer/staticExpressions.js +242 -0
- package/dist/analyzer/staticExpressions.js.map +1 -0
- package/dist/analyzer/symbol.d.ts +50 -0
- package/dist/analyzer/symbol.js +160 -0
- package/dist/analyzer/symbol.js.map +1 -0
- package/dist/analyzer/symbolNameUtils.d.ts +8 -0
- package/dist/analyzer/symbolNameUtils.js +53 -0
- package/dist/analyzer/symbolNameUtils.js.map +1 -0
- package/dist/analyzer/symbolUtils.d.ts +7 -0
- package/dist/analyzer/symbolUtils.js +46 -0
- package/dist/analyzer/symbolUtils.js.map +1 -0
- package/dist/analyzer/testWalker.d.ts +14 -0
- package/dist/analyzer/testWalker.js +92 -0
- package/dist/analyzer/testWalker.js.map +1 -0
- package/dist/analyzer/tracePrinter.d.ts +11 -0
- package/dist/analyzer/tracePrinter.js +222 -0
- package/dist/analyzer/tracePrinter.js.map +1 -0
- package/dist/analyzer/typeCache.d.ts +40 -0
- package/dist/analyzer/typeCache.js +134 -0
- package/dist/analyzer/typeCache.js.map +1 -0
- package/dist/analyzer/typeDocStringUtils.d.ts +12 -0
- package/dist/analyzer/typeDocStringUtils.js +293 -0
- package/dist/analyzer/typeDocStringUtils.js.map +1 -0
- package/dist/analyzer/typeEvaluator.d.ts +18 -0
- package/dist/analyzer/typeEvaluator.js +16598 -0
- package/dist/analyzer/typeEvaluator.js.map +1 -0
- package/dist/analyzer/typeEvaluatorTypes.d.ts +220 -0
- package/dist/analyzer/typeEvaluatorTypes.js +16 -0
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -0
- package/dist/analyzer/typeEvaluatorWithTracker.d.ts +6 -0
- package/dist/analyzer/typeEvaluatorWithTracker.js +121 -0
- package/dist/analyzer/typeEvaluatorWithTracker.js.map +1 -0
- package/dist/analyzer/typeGuards.d.ts +6 -0
- package/dist/analyzer/typeGuards.js +1293 -0
- package/dist/analyzer/typeGuards.js.map +1 -0
- package/dist/analyzer/typePrinter.d.ts +17 -0
- package/dist/analyzer/typePrinter.js +603 -0
- package/dist/analyzer/typePrinter.js.map +1 -0
- package/dist/analyzer/typeStubWriter.d.ts +48 -0
- package/dist/analyzer/typeStubWriter.js +605 -0
- package/dist/analyzer/typeStubWriter.js.map +1 -0
- package/dist/analyzer/typeUtils.d.ts +134 -0
- package/dist/analyzer/typeUtils.js +2380 -0
- package/dist/analyzer/typeUtils.js.map +1 -0
- package/dist/analyzer/typeVarContext.d.ts +50 -0
- package/dist/analyzer/typeVarContext.js +250 -0
- package/dist/analyzer/typeVarContext.js.map +1 -0
- package/dist/analyzer/typedDicts.d.ts +12 -0
- package/dist/analyzer/typedDicts.js +695 -0
- package/dist/analyzer/typedDicts.js.map +1 -0
- package/dist/analyzer/types.d.ts +484 -0
- package/dist/analyzer/types.js +1844 -0
- package/dist/analyzer/types.js.map +1 -0
- package/dist/backgroundAnalysis.d.ts +14 -0
- package/dist/backgroundAnalysis.js +42 -0
- package/dist/backgroundAnalysis.js.map +1 -0
- package/dist/backgroundAnalysisBase.d.ts +83 -0
- package/dist/backgroundAnalysisBase.js +429 -0
- package/dist/backgroundAnalysisBase.js.map +1 -0
- package/dist/backgroundThreadBase.d.ts +34 -0
- package/dist/backgroundThreadBase.js +134 -0
- package/dist/backgroundThreadBase.js.map +1 -0
- package/dist/commands/commandController.d.ts +13 -0
- package/dist/commands/commandController.js +48 -0
- package/dist/commands/commandController.js.map +1 -0
- package/dist/commands/commandResult.d.ts +9 -0
- package/dist/commands/commandResult.js +19 -0
- package/dist/commands/commandResult.js.map +1 -0
- package/dist/commands/commands.d.ts +7 -0
- package/dist/commands/commands.js +11 -0
- package/dist/commands/commands.js.map +1 -0
- package/dist/commands/createTypeStub.d.ts +8 -0
- package/dist/commands/createTypeStub.js +50 -0
- package/dist/commands/createTypeStub.js.map +1 -0
- package/dist/commands/quickActionCommand.d.ts +8 -0
- package/dist/commands/quickActionCommand.js +31 -0
- package/dist/commands/quickActionCommand.js.map +1 -0
- package/dist/commands/restartServer.d.ts +8 -0
- package/dist/commands/restartServer.js +20 -0
- package/dist/commands/restartServer.js.map +1 -0
- package/dist/common/cancellationUtils.d.ts +16 -0
- package/dist/common/cancellationUtils.js +60 -0
- package/dist/common/cancellationUtils.js.map +1 -0
- package/dist/common/chokidarFileWatcherProvider.d.ts +9 -0
- package/dist/common/chokidarFileWatcherProvider.js +88 -0
- package/dist/common/chokidarFileWatcherProvider.js.map +1 -0
- package/dist/common/collectionUtils.d.ts +114 -0
- package/dist/common/collectionUtils.js +292 -0
- package/dist/common/collectionUtils.js.map +1 -0
- package/dist/common/commandLineOptions.d.ts +41 -0
- package/dist/common/commandLineOptions.js +46 -0
- package/dist/common/commandLineOptions.js.map +1 -0
- package/dist/common/configOptions.d.ts +144 -0
- package/dist/common/configOptions.js +908 -0
- package/dist/common/configOptions.js.map +1 -0
- package/dist/common/console.d.ts +61 -0
- package/dist/common/console.js +191 -0
- package/dist/common/console.js.map +1 -0
- package/dist/common/core.d.ts +67 -0
- package/dist/common/core.js +118 -0
- package/dist/common/core.js.map +1 -0
- package/dist/common/crypto.d.ts +1 -0
- package/dist/common/crypto.js +37 -0
- package/dist/common/crypto.js.map +1 -0
- package/dist/common/debug.d.ts +13 -0
- package/dist/common/debug.js +131 -0
- package/dist/common/debug.js.map +1 -0
- package/dist/common/deferred.d.ts +11 -0
- package/dist/common/deferred.js +62 -0
- package/dist/common/deferred.js.map +1 -0
- package/dist/common/diagnostic.d.ts +59 -0
- package/dist/common/diagnostic.js +134 -0
- package/dist/common/diagnostic.js.map +1 -0
- package/dist/common/diagnosticRules.d.ts +67 -0
- package/dist/common/diagnosticRules.js +83 -0
- package/dist/common/diagnosticRules.js.map +1 -0
- package/dist/common/diagnosticSink.d.ts +34 -0
- package/dist/common/diagnosticSink.js +110 -0
- package/dist/common/diagnosticSink.js.map +1 -0
- package/dist/common/editAction.d.ts +29 -0
- package/dist/common/editAction.js +11 -0
- package/dist/common/editAction.js.map +1 -0
- package/dist/common/extensibility.d.ts +11 -0
- package/dist/common/extensibility.js +10 -0
- package/dist/common/extensibility.js.map +1 -0
- package/dist/common/extensions.d.ts +3 -0
- package/dist/common/extensions.js +15 -0
- package/dist/common/extensions.js.map +1 -0
- package/dist/common/fileBasedCancellationUtils.d.ts +11 -0
- package/dist/common/fileBasedCancellationUtils.js +259 -0
- package/dist/common/fileBasedCancellationUtils.js.map +1 -0
- package/dist/common/fileSystem.d.ts +72 -0
- package/dist/common/fileSystem.js +69 -0
- package/dist/common/fileSystem.js.map +1 -0
- package/dist/common/fullAccessHost.d.ts +19 -0
- package/dist/common/fullAccessHost.js +193 -0
- package/dist/common/fullAccessHost.js.map +1 -0
- package/dist/common/host.d.ts +21 -0
- package/dist/common/host.js +30 -0
- package/dist/common/host.js.map +1 -0
- package/dist/common/logTracker.d.ts +15 -0
- package/dist/common/logTracker.js +129 -0
- package/dist/common/logTracker.js.map +1 -0
- package/dist/common/lspUtils.d.ts +3 -0
- package/dist/common/lspUtils.js +20 -0
- package/dist/common/lspUtils.js.map +1 -0
- package/dist/common/memUtils.d.ts +3 -0
- package/dist/common/memUtils.js +37 -0
- package/dist/common/memUtils.js.map +1 -0
- package/dist/common/pathConsts.d.ts +8 -0
- package/dist/common/pathConsts.js +19 -0
- package/dist/common/pathConsts.js.map +1 -0
- package/dist/common/pathUtils.d.ts +170 -0
- package/dist/common/pathUtils.js +762 -0
- package/dist/common/pathUtils.js.map +1 -0
- package/dist/common/positionUtils.d.ts +7 -0
- package/dist/common/positionUtils.js +71 -0
- package/dist/common/positionUtils.js.map +1 -0
- package/dist/common/progressReporter.d.ts +15 -0
- package/dist/common/progressReporter.js +44 -0
- package/dist/common/progressReporter.js.map +1 -0
- package/dist/common/pythonVersion.d.ts +20 -0
- package/dist/common/pythonVersion.js +71 -0
- package/dist/common/pythonVersion.js.map +1 -0
- package/dist/common/realFileSystem.d.ts +8 -0
- package/dist/common/realFileSystem.js +368 -0
- package/dist/common/realFileSystem.js.map +1 -0
- package/dist/common/stringUtils.d.ts +47 -0
- package/dist/common/stringUtils.js +160 -0
- package/dist/common/stringUtils.js.map +1 -0
- package/dist/common/textEditUtils.d.ts +3 -0
- package/dist/common/textEditUtils.js +29 -0
- package/dist/common/textEditUtils.js.map +1 -0
- package/dist/common/textRange.d.ts +47 -0
- package/dist/common/textRange.js +211 -0
- package/dist/common/textRange.js.map +1 -0
- package/dist/common/textRangeCollection.d.ts +13 -0
- package/dist/common/textRangeCollection.js +108 -0
- package/dist/common/textRangeCollection.js.map +1 -0
- package/dist/common/timing.d.ts +31 -0
- package/dist/common/timing.js +100 -0
- package/dist/common/timing.js.map +1 -0
- package/dist/common/uriParser.d.ts +12 -0
- package/dist/common/uriParser.js +25 -0
- package/dist/common/uriParser.js.map +1 -0
- package/dist/common/workspaceEditUtils.d.ts +7 -0
- package/dist/common/workspaceEditUtils.js +63 -0
- package/dist/common/workspaceEditUtils.js.map +1 -0
- package/dist/languageServerBase.d.ts +211 -0
- package/dist/languageServerBase.js +923 -0
- package/dist/languageServerBase.js.map +1 -0
- package/dist/languageService/analyzerServiceExecutor.d.ts +8 -0
- package/dist/languageService/analyzerServiceExecutor.js +97 -0
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -0
- package/dist/languageService/autoImporter.d.ts +84 -0
- package/dist/languageService/autoImporter.js +635 -0
- package/dist/languageService/autoImporter.js.map +1 -0
- package/dist/languageService/callHierarchyProvider.d.ts +12 -0
- package/dist/languageService/callHierarchyProvider.js +368 -0
- package/dist/languageService/callHierarchyProvider.js.map +1 -0
- package/dist/languageService/codeActionProvider.d.ts +6 -0
- package/dist/languageService/codeActionProvider.js +53 -0
- package/dist/languageService/codeActionProvider.js.map +1 -0
- package/dist/languageService/completionProvider.d.ts +147 -0
- package/dist/languageService/completionProvider.js +2220 -0
- package/dist/languageService/completionProvider.js.map +1 -0
- package/dist/languageService/definitionProvider.d.ts +17 -0
- package/dist/languageService/definitionProvider.js +206 -0
- package/dist/languageService/definitionProvider.js.map +1 -0
- package/dist/languageService/documentHighlightProvider.d.ts +7 -0
- package/dist/languageService/documentHighlightProvider.js +63 -0
- package/dist/languageService/documentHighlightProvider.js.map +1 -0
- package/dist/languageService/documentSymbolCollector.d.ts +37 -0
- package/dist/languageService/documentSymbolCollector.js +344 -0
- package/dist/languageService/documentSymbolCollector.js.map +1 -0
- package/dist/languageService/documentSymbolProvider.d.ts +37 -0
- package/dist/languageService/documentSymbolProvider.js +308 -0
- package/dist/languageService/documentSymbolProvider.js.map +1 -0
- package/dist/languageService/hoverProvider.d.ts +25 -0
- package/dist/languageService/hoverProvider.js +366 -0
- package/dist/languageService/hoverProvider.js.map +1 -0
- package/dist/languageService/importAdder.d.ts +24 -0
- package/dist/languageService/importAdder.js +296 -0
- package/dist/languageService/importAdder.js.map +1 -0
- package/dist/languageService/importSorter.d.ts +15 -0
- package/dist/languageService/importSorter.js +152 -0
- package/dist/languageService/importSorter.js.map +1 -0
- package/dist/languageService/indentationUtils.d.ts +4 -0
- package/dist/languageService/indentationUtils.js +597 -0
- package/dist/languageService/indentationUtils.js.map +1 -0
- package/dist/languageService/quickActions.d.ts +4 -0
- package/dist/languageService/quickActions.js +97 -0
- package/dist/languageService/quickActions.js.map +1 -0
- package/dist/languageService/referencesProvider.d.ts +36 -0
- package/dist/languageService/referencesProvider.js +236 -0
- package/dist/languageService/referencesProvider.js.map +1 -0
- package/dist/languageService/renameModuleProvider.d.ts +58 -0
- package/dist/languageService/renameModuleProvider.js +884 -0
- package/dist/languageService/renameModuleProvider.js.map +1 -0
- package/dist/languageService/signatureHelpProvider.d.ts +26 -0
- package/dist/languageService/signatureHelpProvider.js +180 -0
- package/dist/languageService/signatureHelpProvider.js.map +1 -0
- package/dist/languageService/tooltipUtils.d.ts +9 -0
- package/dist/languageService/tooltipUtils.js +129 -0
- package/dist/languageService/tooltipUtils.js.map +1 -0
- package/dist/localization/localize.d.ts +1324 -0
- package/dist/localization/localize.js +788 -0
- package/dist/localization/localize.js.map +1 -0
- package/dist/localization/package.nls.de.json +1 -0
- package/dist/localization/package.nls.en-us.json +636 -0
- package/dist/localization/package.nls.es.json +1 -0
- package/dist/localization/package.nls.fr.json +1 -0
- package/dist/localization/package.nls.ja.json +1 -0
- package/dist/localization/package.nls.ru.json +1 -0
- package/dist/localization/package.nls.zh-cn.json +1 -0
- package/dist/localization/package.nls.zh-tw.json +1 -0
- package/dist/nodeMain.d.ts +1 -0
- package/dist/nodeMain.js +21 -0
- package/dist/nodeMain.js.map +1 -0
- package/dist/nodeServer.d.ts +3 -0
- package/dist/nodeServer.js +31 -0
- package/dist/nodeServer.js.map +1 -0
- package/dist/parser/characterStream.d.ts +27 -0
- package/dist/parser/characterStream.js +120 -0
- package/dist/parser/characterStream.js.map +1 -0
- package/dist/parser/characters.d.ts +17 -0
- package/dist/parser/characters.js +240 -0
- package/dist/parser/characters.js.map +1 -0
- package/dist/parser/parseNodes.d.ts +750 -0
- package/dist/parser/parseNodes.js +1406 -0
- package/dist/parser/parseNodes.js.map +1 -0
- package/dist/parser/parser.d.ts +191 -0
- package/dist/parser/parser.js +3806 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/parser/stringTokenUtils.d.ts +25 -0
- package/dist/parser/stringTokenUtils.js +455 -0
- package/dist/parser/stringTokenUtils.js.map +1 -0
- package/dist/parser/tokenizer.d.ts +71 -0
- package/dist/parser/tokenizer.js +1111 -0
- package/dist/parser/tokenizer.js.map +1 -0
- package/dist/parser/tokenizerTypes.d.ts +223 -0
- package/dist/parser/tokenizerTypes.js +164 -0
- package/dist/parser/tokenizerTypes.js.map +1 -0
- package/dist/parser/unicode.d.ts +23 -0
- package/dist/parser/unicode.js +2899 -0
- package/dist/parser/unicode.js.map +1 -0
- package/dist/pyright.d.ts +1 -0
- package/dist/pyright.js +645 -0
- package/dist/pyright.js.map +1 -0
- package/dist/pyrightFileSystem.d.ts +28 -0
- package/dist/pyrightFileSystem.js +196 -0
- package/dist/pyrightFileSystem.js.map +1 -0
- package/dist/readonlyAugmentedFileSystem.d.ts +40 -0
- package/dist/readonlyAugmentedFileSystem.js +155 -0
- package/dist/readonlyAugmentedFileSystem.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.js +232 -0
- package/dist/server.js.map +1 -0
- package/dist/tests/chainedSourceFiles.test.d.ts +1 -0
- package/dist/tests/chainedSourceFiles.test.js +153 -0
- package/dist/tests/chainedSourceFiles.test.js.map +1 -0
- package/dist/tests/checker.test.d.ts +1 -0
- package/dist/tests/checker.test.js +346 -0
- package/dist/tests/checker.test.js.map +1 -0
- package/dist/tests/collectionUtils.test.d.ts +1 -0
- package/dist/tests/collectionUtils.test.js +153 -0
- package/dist/tests/collectionUtils.test.js.map +1 -0
- package/dist/tests/common.test.d.ts +1 -0
- package/dist/tests/common.test.js +125 -0
- package/dist/tests/common.test.js.map +1 -0
- package/dist/tests/config.test.d.ts +1 -0
- package/dist/tests/config.test.js +230 -0
- package/dist/tests/config.test.js.map +1 -0
- package/dist/tests/debug.test.d.ts +1 -0
- package/dist/tests/debug.test.js +102 -0
- package/dist/tests/debug.test.js.map +1 -0
- package/dist/tests/deferred.test.d.ts +1 -0
- package/dist/tests/deferred.test.js +65 -0
- package/dist/tests/deferred.test.js.map +1 -0
- package/dist/tests/diagnosticOverrides.test.d.ts +1 -0
- package/dist/tests/diagnosticOverrides.test.js +108 -0
- package/dist/tests/diagnosticOverrides.test.js.map +1 -0
- package/dist/tests/docStringConversion.test.d.ts +1 -0
- package/dist/tests/docStringConversion.test.js +695 -0
- package/dist/tests/docStringConversion.test.js.map +1 -0
- package/dist/tests/docStringUtils.test.d.ts +1 -0
- package/dist/tests/docStringUtils.test.js +70 -0
- package/dist/tests/docStringUtils.test.js.map +1 -0
- package/dist/tests/documentSymbolCollector.test.d.ts +1 -0
- package/dist/tests/documentSymbolCollector.test.js +635 -0
- package/dist/tests/documentSymbolCollector.test.js.map +1 -0
- package/dist/tests/filesystem.test.d.ts +1 -0
- package/dist/tests/filesystem.test.js +194 -0
- package/dist/tests/filesystem.test.js.map +1 -0
- package/dist/tests/fourSlashParser.test.d.ts +1 -0
- package/dist/tests/fourSlashParser.test.js +281 -0
- package/dist/tests/fourSlashParser.test.js.map +1 -0
- package/dist/tests/fourSlashRunner.test.d.ts +1 -0
- package/dist/tests/fourSlashRunner.test.js +52 -0
- package/dist/tests/fourSlashRunner.test.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.js +30 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.js +42 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.js +13 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.js +23 -0
- package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.js +35 -0
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.autoimport.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.js +128 -0
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.js +43 -0
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.js +29 -0
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.js +50 -0
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.js +116 -0
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.builtinOverride.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.builtinOverride.fourslash.js +21 -0
- package/dist/tests/fourslash/completions.builtinOverride.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.js +54 -0
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.js +245 -0
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.js +162 -0
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.js +132 -0
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.classVariable.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.classVariable.fourslash.js +37 -0
- package/dist/tests/fourslash/completions.classVariable.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.comment.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.comment.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.comment.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.class.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.class.fourslash.js +30 -0
- package/dist/tests/fourslash/completions.declNames.class.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.exception.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.exception.fourslash.js +18 -0
- package/dist/tests/fourslash/completions.declNames.exception.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.for.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.for.fourslash.js +26 -0
- package/dist/tests/fourslash/completions.declNames.for.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.js +15 -0
- package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.js +36 -0
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.method.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.method.fourslash.js +68 -0
- package/dist/tests/fourslash/completions.declNames.method.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.js +147 -0
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.js +131 -0
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.js +73 -0
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.js +58 -0
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.js +154 -0
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.js +143 -0
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.js +109 -0
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.js +50 -0
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.enums.members.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.enums.members.fourslash.js +44 -0
- package/dist/tests/fourslash/completions.enums.members.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.excluded.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.excluded.fourslash.js +12 -0
- package/dist/tests/fourslash/completions.excluded.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fourslash.js +51 -0
- package/dist/tests/fourslash/completions.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fstring.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fstring.fourslash.js +32 -0
- package/dist/tests/fourslash/completions.fstring.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.js +96 -0
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.js +30 -0
- package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.importDunderNames.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.importDunderNames.fourslash.js +29 -0
- package/dist/tests/fourslash/completions.importDunderNames.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.importSubmodule.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.importSubmodule.fourslash.js +22 -0
- package/dist/tests/fourslash/completions.importSubmodule.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.importsDuplicates.fourslash.d.ts +0 -0
- package/dist/tests/fourslash/completions.importsDuplicates.fourslash.js +22 -0
- package/dist/tests/fourslash/completions.importsDuplicates.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inList.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inList.fourslash.js +32 -0
- package/dist/tests/fourslash/completions.inList.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.included.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.included.fourslash.js +12 -0
- package/dist/tests/fourslash/completions.included.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.js +54 -0
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.js +26 -0
- package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.js +49 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.js +50 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.js +101 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.js +105 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.js +67 -0
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.js +75 -0
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.js +66 -0
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.libStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.libStub.fourslash.js +66 -0
- package/dist/tests/fourslash/completions.libStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.literals.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.literals.fourslash.js +31 -0
- package/dist/tests/fourslash/completions.literals.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.localCode.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.localCode.fourslash.js +71 -0
- package/dist/tests/fourslash/completions.localCode.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.js +17 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.js +57 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.overloads.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.overloads.fourslash.js +37 -0
- package/dist/tests/fourslash/completions.overloads.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.default.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.importStub.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.importStub.js +49 -0
- package/dist/tests/fourslash/completions.override.default.importStub.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.imported.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.imported.fourslash.js +60 -0
- package/dist/tests/fourslash/completions.override.default.imported.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.stub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.stub.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.default.stub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.property.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.property.fourslash.js +31 -0
- package/dist/tests/fourslash/completions.override.property.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.property.stub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.property.stub.fourslash.js +31 -0
- package/dist/tests/fourslash/completions.override.property.stub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.js +63 -0
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.stub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.stub.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.stub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override2.fourslash.js +66 -0
- package/dist/tests/fourslash/completions.override2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.parameters.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.parameters.fourslash.js +22 -0
- package/dist/tests/fourslash/completions.parameters.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.params.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.params.fourslash.js +23 -0
- package/dist/tests/fourslash/completions.params.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.parentFolder.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.parentFolder.fourslash.js +15 -0
- package/dist/tests/fourslash/completions.parentFolder.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.parentFolders.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.parentFolders.fourslash.js +68 -0
- package/dist/tests/fourslash/completions.parentFolders.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.plainText.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.plainText.fourslash.js +34 -0
- package/dist/tests/fourslash/completions.plainText.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.private.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.private.fourslash.js +61 -0
- package/dist/tests/fourslash/completions.private.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.property.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.property.fourslash.js +28 -0
- package/dist/tests/fourslash/completions.property.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.js +64 -0
- package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.self.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.self.fourslash.js +43 -0
- package/dist/tests/fourslash/completions.self.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.js +71 -0
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.js +78 -0
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.typeAlias.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.typeAlias.fourslash.js +29 -0
- package/dist/tests/fourslash/completions.typeAlias.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.typeshed.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.typeshed.fourslash.js +9 -0
- package/dist/tests/fourslash/completions.typeshed.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.vardecls.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.vardecls.fourslash.js +33 -0
- package/dist/tests/fourslash/completions.vardecls.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.js +68 -0
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.js +109 -0
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.with.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.with.fourslash.js +25 -0
- package/dist/tests/fourslash/completions.with.fourslash.js.map +1 -0
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.js +64 -0
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.js +24 -0
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.js +93 -0
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.js +23 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.js +19 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.js +23 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.js +20 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.js +123 -0
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.js +79 -0
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.js +154 -0
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.js +42 -0
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.js +34 -0
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.js +213 -0
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.js +154 -0
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.js +23 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.js +29 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.js +30 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.js +25 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.js +26 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.js +28 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.js +33 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.js +26 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.js +25 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.js +25 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.js +20 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.js +20 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.js +59 -0
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.js +59 -0
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.js +94 -0
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.js +79 -0
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.js +106 -0
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.js +24 -0
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.js +66 -0
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.js +26 -0
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.js +36 -0
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.fourslash.js +30 -0
- package/dist/tests/fourslash/findallreferences.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.js +30 -0
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.js +46 -0
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.js +60 -0
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.js +54 -0
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.modules.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.modules.fourslash.js +41 -0
- package/dist/tests/fourslash/findallreferences.modules.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.js +83 -0
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.js +32 -0
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.js +22 -0
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.js +29 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.js +33 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.js +36 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.js +44 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.js +31 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.variable.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.variable.fourslash.js +22 -0
- package/dist/tests/fourslash/findallreferences.variable.fourslash.js.map +1 -0
- package/dist/tests/fourslash/fourslash.d.ts +301 -0
- package/dist/tests/fourslash/fourslash.js +25 -0
- package/dist/tests/fourslash/fourslash.js.map +1 -0
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.js +30 -0
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.js +63 -0
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.classNoInit.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.classNoInit.fourslash.js +14 -0
- package/dist/tests/fourslash/hover.classNoInit.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromScr.stringFormat.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromScr.stringFormat.fourslash.js +47 -0
- package/dist/tests/fourslash/hover.docFromScr.stringFormat.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.js +77 -0
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.js +22 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.js +22 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.js +21 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.js +20 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.js +38 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.js +25 -0
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.js +18 -0
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docstring.links.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docstring.links.fourslash.js +12 -0
- package/dist/tests/fourslash/hover.docstring.links.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docstring.overloads.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docstring.overloads.fourslash.js +38 -0
- package/dist/tests/fourslash/hover.docstring.overloads.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docstring.split.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docstring.split.fourslash.js +24 -0
- package/dist/tests/fourslash/hover.docstring.split.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.fourslash.js +20 -0
- package/dist/tests/fourslash/hover.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.import.django.view.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.import.django.view.fourslash.js +23 -0
- package/dist/tests/fourslash/hover.import.django.view.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.import.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.import.fourslash.js +10 -0
- package/dist/tests/fourslash/hover.import.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.js +61 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.js +51 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.js +40 -0
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.js +43 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.js +44 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.js +84 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.js +88 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.init.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.init.fourslash.js +38 -0
- package/dist/tests/fourslash/hover.init.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.js +49 -0
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.js +39 -0
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.libStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.libStub.fourslash.js +39 -0
- package/dist/tests/fourslash/hover.libStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.js +14 -0
- package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.plainText.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.plainText.fourslash.js +20 -0
- package/dist/tests/fourslash/hover.plainText.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.typedDict.key.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.typedDict.key.fourslash.js +50 -0
- package/dist/tests/fourslash/hover.typedDict.key.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.variable.docString.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.variable.docString.fourslash.js +35 -0
- package/dist/tests/fourslash/hover.variable.docString.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.js +73 -0
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.publicSymbols.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.publicSymbols.fourslash.js +63 -0
- package/dist/tests/fourslash/import.publicSymbols.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.js +72 -0
- package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.js +61 -0
- package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.js +35 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.js +35 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.wildcard.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.wildcard.fourslash.js +24 -0
- package/dist/tests/fourslash/import.wildcard.fourslash.js.map +1 -0
- package/dist/tests/fourslash/importnotresolved.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/importnotresolved.fourslash.js +13 -0
- package/dist/tests/fourslash/importnotresolved.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.js +18 -0
- package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingModuleSource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingModuleSource.fourslash.js +13 -0
- package/dist/tests/fourslash/missingModuleSource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.js +31 -0
- package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.d.ts +7 -0
- package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.js +44 -0
- package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.d.ts +7 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.js +35 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.d.ts +7 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.js +35 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingTypeStub.fourslash.js +18 -0
- package/dist/tests/fourslash/missingTypeStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.js +34 -0
- package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.js.map +1 -0
- package/dist/tests/fourslash/noerrors.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/noerrors.fourslash.js +9 -0
- package/dist/tests/fourslash/noerrors.fourslash.js.map +1 -0
- package/dist/tests/fourslash/orderImports1.command.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/orderImports1.command.fourslash.js +17 -0
- package/dist/tests/fourslash/orderImports1.command.fourslash.js.map +1 -0
- package/dist/tests/fourslash/orderImports2.command.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/orderImports2.command.fourslash.js +21 -0
- package/dist/tests/fourslash/orderImports2.command.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.fourslash.js +23 -0
- package/dist/tests/fourslash/rename.externallyHidden.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.js +23 -0
- package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.fourslash.js +26 -0
- package/dist/tests/fourslash/rename.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.library.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.library.fourslash.js +26 -0
- package/dist/tests/fourslash/rename.library.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.js +29 -0
- package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.d.ts +2 -0
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.js +19 -0
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.js +33 -0
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.string.excluded.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.string.excluded.fourslash.js +39 -0
- package/dist/tests/fourslash/rename.string.excluded.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.string.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.string.fourslash.js +25 -0
- package/dist/tests/fourslash/rename.string.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js +62 -0
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.complicated.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.complicated.fourslash.js +97 -0
- package/dist/tests/fourslash/signature.complicated.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.cornercases.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.cornercases.fourslash.js +22 -0
- package/dist/tests/fourslash/signature.cornercases.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.docstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.docstrings.fourslash.js +42 -0
- package/dist/tests/fourslash/signature.docstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.js +49 -0
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.js +115 -0
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.overload.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.overload.fourslash.js +63 -0
- package/dist/tests/fourslash/signature.overload.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.simple.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.simple.fourslash.js +104 -0
- package/dist/tests/fourslash/signature.simple.fourslash.js.map +1 -0
- package/dist/tests/harness/fourslash/fourSlashParser.d.ts +10 -0
- package/dist/tests/harness/fourslash/fourSlashParser.js +347 -0
- package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -0
- package/dist/tests/harness/fourslash/fourSlashTypes.d.ts +81 -0
- package/dist/tests/harness/fourslash/fourSlashTypes.js +65 -0
- package/dist/tests/harness/fourslash/fourSlashTypes.js.map +1 -0
- package/dist/tests/harness/fourslash/runner.d.ts +20 -0
- package/dist/tests/harness/fourslash/runner.js +93 -0
- package/dist/tests/harness/fourslash/runner.js.map +1 -0
- package/dist/tests/harness/fourslash/testLanguageService.d.ts +40 -0
- package/dist/tests/harness/fourslash/testLanguageService.js +120 -0
- package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -0
- package/dist/tests/harness/fourslash/testState.Consts.d.ts +11 -0
- package/dist/tests/harness/fourslash/testState.Consts.js +50 -0
- package/dist/tests/harness/fourslash/testState.Consts.js.map +1 -0
- package/dist/tests/harness/fourslash/testState.d.ts +232 -0
- package/dist/tests/harness/fourslash/testState.js +1381 -0
- package/dist/tests/harness/fourslash/testState.js.map +1 -0
- package/dist/tests/harness/testAccessHost.d.ts +8 -0
- package/dist/tests/harness/testAccessHost.js +26 -0
- package/dist/tests/harness/testAccessHost.js.map +1 -0
- package/dist/tests/harness/testHost.d.ts +16 -0
- package/dist/tests/harness/testHost.js +161 -0
- package/dist/tests/harness/testHost.js.map +1 -0
- package/dist/tests/harness/utils.d.ts +74 -0
- package/dist/tests/harness/utils.js +328 -0
- package/dist/tests/harness/utils.js.map +1 -0
- package/dist/tests/harness/vfs/factory.d.ts +32 -0
- package/dist/tests/harness/vfs/factory.js +173 -0
- package/dist/tests/harness/vfs/factory.js.map +1 -0
- package/dist/tests/harness/vfs/filesystem.d.ts +430 -0
- package/dist/tests/harness/vfs/filesystem.js +1455 -0
- package/dist/tests/harness/vfs/filesystem.js.map +1 -0
- package/dist/tests/harness/vfs/pathValidation.d.ts +24 -0
- package/dist/tests/harness/vfs/pathValidation.js +123 -0
- package/dist/tests/harness/vfs/pathValidation.js.map +1 -0
- package/dist/tests/importAdder.test.d.ts +1 -0
- package/dist/tests/importAdder.test.js +1192 -0
- package/dist/tests/importAdder.test.js.map +1 -0
- package/dist/tests/importResolver.test.d.ts +1 -0
- package/dist/tests/importResolver.test.js +450 -0
- package/dist/tests/importResolver.test.js.map +1 -0
- package/dist/tests/importStatementUtils.test.d.ts +1 -0
- package/dist/tests/importStatementUtils.test.js +371 -0
- package/dist/tests/importStatementUtils.test.js.map +1 -0
- package/dist/tests/indentationUtils.ptvs.test.d.ts +1 -0
- package/dist/tests/indentationUtils.ptvs.test.js +324 -0
- package/dist/tests/indentationUtils.ptvs.test.js.map +1 -0
- package/dist/tests/indentationUtils.reindent.test.d.ts +1 -0
- package/dist/tests/indentationUtils.reindent.test.js +332 -0
- package/dist/tests/indentationUtils.reindent.test.js.map +1 -0
- package/dist/tests/indentationUtils.test.d.ts +1 -0
- package/dist/tests/indentationUtils.test.js +375 -0
- package/dist/tests/indentationUtils.test.js.map +1 -0
- package/dist/tests/ipythonMode.test.d.ts +1 -0
- package/dist/tests/ipythonMode.test.js +303 -0
- package/dist/tests/ipythonMode.test.js.map +1 -0
- package/dist/tests/localizer.test.d.ts +1 -0
- package/dist/tests/localizer.test.js +64 -0
- package/dist/tests/localizer.test.js.map +1 -0
- package/dist/tests/parseTreeUtils.test.d.ts +1 -0
- package/dist/tests/parseTreeUtils.test.js +228 -0
- package/dist/tests/parseTreeUtils.test.js.map +1 -0
- package/dist/tests/parser.test.d.ts +1 -0
- package/dist/tests/parser.test.js +101 -0
- package/dist/tests/parser.test.js.map +1 -0
- package/dist/tests/pathUtils.test.d.ts +1 -0
- package/dist/tests/pathUtils.test.js +253 -0
- package/dist/tests/pathUtils.test.js.map +1 -0
- package/dist/tests/pyrightFileSystem.test.d.ts +1 -0
- package/dist/tests/pyrightFileSystem.test.js +152 -0
- package/dist/tests/pyrightFileSystem.test.js.map +1 -0
- package/dist/tests/renameModule.folder.test.d.ts +1 -0
- package/dist/tests/renameModule.folder.test.js +229 -0
- package/dist/tests/renameModule.folder.test.js.map +1 -0
- package/dist/tests/renameModule.fromImports.test.d.ts +1 -0
- package/dist/tests/renameModule.fromImports.test.js +790 -0
- package/dist/tests/renameModule.fromImports.test.js.map +1 -0
- package/dist/tests/renameModule.imports.test.d.ts +1 -0
- package/dist/tests/renameModule.imports.test.js +380 -0
- package/dist/tests/renameModule.imports.test.js.map +1 -0
- package/dist/tests/renameModule.misc.test.d.ts +1 -0
- package/dist/tests/renameModule.misc.test.js +615 -0
- package/dist/tests/renameModule.misc.test.js.map +1 -0
- package/dist/tests/renameModule.relativePath.test.d.ts +1 -0
- package/dist/tests/renameModule.relativePath.test.js +231 -0
- package/dist/tests/renameModule.relativePath.test.js.map +1 -0
- package/dist/tests/renameModuleTestUtils.d.ts +4 -0
- package/dist/tests/renameModuleTestUtils.js +148 -0
- package/dist/tests/renameModuleTestUtils.js.map +1 -0
- package/dist/tests/sourceFile.test.d.ts +1 -0
- package/dist/tests/sourceFile.test.js +25 -0
- package/dist/tests/sourceFile.test.js.map +1 -0
- package/dist/tests/stringUtils.test.d.ts +1 -0
- package/dist/tests/stringUtils.test.js +69 -0
- package/dist/tests/stringUtils.test.js.map +1 -0
- package/dist/tests/symbolNameUtils.test.d.ts +1 -0
- package/dist/tests/symbolNameUtils.test.js +83 -0
- package/dist/tests/symbolNameUtils.test.js.map +1 -0
- package/dist/tests/testState.test.d.ts +1 -0
- package/dist/tests/testState.test.js +521 -0
- package/dist/tests/testState.test.js.map +1 -0
- package/dist/tests/testUtils.d.ts +27 -0
- package/dist/tests/testUtils.js +213 -0
- package/dist/tests/testUtils.js.map +1 -0
- package/dist/tests/tokenizer.test.d.ts +1 -0
- package/dist/tests/tokenizer.test.js +1277 -0
- package/dist/tests/tokenizer.test.js.map +1 -0
- package/dist/tests/typeEvaluator1.test.d.ts +1 -0
- package/dist/tests/typeEvaluator1.test.js +1023 -0
- package/dist/tests/typeEvaluator1.test.js.map +1 -0
- package/dist/tests/typeEvaluator2.test.d.ts +1 -0
- package/dist/tests/typeEvaluator2.test.js +869 -0
- package/dist/tests/typeEvaluator2.test.js.map +1 -0
- package/dist/tests/typeEvaluator3.test.d.ts +1 -0
- package/dist/tests/typeEvaluator3.test.js +915 -0
- package/dist/tests/typeEvaluator3.test.js.map +1 -0
- package/dist/tests/typeEvaluator4.test.d.ts +1 -0
- package/dist/tests/typeEvaluator4.test.js +901 -0
- package/dist/tests/typeEvaluator4.test.js.map +1 -0
- package/dist/tests/updateSymbolReference.test.d.ts +1 -0
- package/dist/tests/updateSymbolReference.test.js +980 -0
- package/dist/tests/updateSymbolReference.test.js.map +1 -0
- package/dist/tests/zipfs.test.d.ts +1 -0
- package/dist/tests/zipfs.test.js +112 -0
- package/dist/tests/zipfs.test.js.map +1 -0
- package/dist/workspaceMap.d.ts +6 -0
- package/dist/workspaceMap.js +73 -0
- package/dist/workspaceMap.js.map +1 -0
- package/package.json +45 -0
@@ -0,0 +1,1844 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* types.ts
|
4
|
+
* Copyright (c) Microsoft Corporation.
|
5
|
+
* Licensed under the MIT license.
|
6
|
+
* Author: Eric Traut
|
7
|
+
*
|
8
|
+
* Representation of types used during type analysis within Python.
|
9
|
+
*/
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
11
|
+
exports.isSameWithoutLiteralValue = exports.combineTypes = exports.findSubtype = exports.removeFromUnion = exports.removeNoneFromUnion = exports.removeUnbound = exports.removeIncompleteUnknownFromUnion = exports.removeUnknownFromUnion = exports.isTypeSame = exports.getTypeAliasInfo = exports.isOverloadedFunction = exports.isFunction = exports.isParamSpec = exports.isUnpacked = exports.isUnpackedClass = exports.isUnpackedVariadicTypeVar = exports.isVariadicTypeVar = exports.isTypeVar = exports.isModule = exports.isClassInstance = exports.isInstantiableClass = exports.isClass = exports.isPossiblyUnbound = exports.isUnion = exports.isUnbound = exports.isAnyOrUnknown = exports.isUnknown = exports.isAny = exports.isNoneTypeClass = exports.isNoneInstance = exports.isNever = exports.TypeVarType = exports.UnionType = exports.TypeCondition = exports.AnyType = exports.NeverType = exports.NoneType = exports.OverloadedFunctionType = exports.FunctionType = exports.ClassType = exports.ModuleType = exports.UnknownType = exports.UnboundType = exports.TypeBase = exports.maxTypeRecursionCount = exports.EnumLiteral = exports.WildcardTypeVarScopeId = void 0;
|
12
|
+
const debug_1 = require("../common/debug");
|
13
|
+
exports.WildcardTypeVarScopeId = '*';
|
14
|
+
class EnumLiteral {
|
15
|
+
constructor(className, itemName, itemType) {
|
16
|
+
this.className = className;
|
17
|
+
this.itemName = itemName;
|
18
|
+
this.itemType = itemType;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
exports.EnumLiteral = EnumLiteral;
|
22
|
+
exports.maxTypeRecursionCount = 14;
|
23
|
+
var TypeBase;
|
24
|
+
(function (TypeBase) {
|
25
|
+
function isInstantiable(type) {
|
26
|
+
return (type.flags & 1 /* Instantiable */) !== 0;
|
27
|
+
}
|
28
|
+
TypeBase.isInstantiable = isInstantiable;
|
29
|
+
function isInstance(type) {
|
30
|
+
return (type.flags & 2 /* Instance */) !== 0;
|
31
|
+
}
|
32
|
+
TypeBase.isInstance = isInstance;
|
33
|
+
function isAnnotated(type) {
|
34
|
+
return (type.flags & 4 /* Annotated */) !== 0;
|
35
|
+
}
|
36
|
+
TypeBase.isAnnotated = isAnnotated;
|
37
|
+
function isSpecialForm(type) {
|
38
|
+
return (type.flags & 8 /* SpecialForm */) !== 0;
|
39
|
+
}
|
40
|
+
TypeBase.isSpecialForm = isSpecialForm;
|
41
|
+
function setSpecialForm(type) {
|
42
|
+
return (type.flags |= 8 /* SpecialForm */);
|
43
|
+
}
|
44
|
+
TypeBase.setSpecialForm = setSpecialForm;
|
45
|
+
function isAmbiguous(type) {
|
46
|
+
return !!type.isAmbiguous;
|
47
|
+
}
|
48
|
+
TypeBase.isAmbiguous = isAmbiguous;
|
49
|
+
function cloneType(type) {
|
50
|
+
return { ...type };
|
51
|
+
}
|
52
|
+
TypeBase.cloneType = cloneType;
|
53
|
+
function cloneTypeAsInstance(type) {
|
54
|
+
(0, debug_1.assert)(TypeBase.isInstantiable(type));
|
55
|
+
const newInstance = TypeBase.cloneType(type);
|
56
|
+
if (newInstance.instantiableNestingLevel === undefined) {
|
57
|
+
newInstance.flags &= ~1 /* Instantiable */;
|
58
|
+
newInstance.flags |= 2 /* Instance */;
|
59
|
+
delete newInstance.instantiableNestingLevel;
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
if (newInstance.instantiableNestingLevel === 1) {
|
63
|
+
delete newInstance.instantiableNestingLevel;
|
64
|
+
}
|
65
|
+
else {
|
66
|
+
newInstance.instantiableNestingLevel--;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
return newInstance;
|
70
|
+
}
|
71
|
+
TypeBase.cloneTypeAsInstance = cloneTypeAsInstance;
|
72
|
+
function cloneTypeAsInstantiable(type) {
|
73
|
+
const newInstance = TypeBase.cloneType(type);
|
74
|
+
if (TypeBase.isInstance(type)) {
|
75
|
+
newInstance.flags &= ~2 /* Instance */;
|
76
|
+
newInstance.flags |= 1 /* Instantiable */;
|
77
|
+
}
|
78
|
+
else {
|
79
|
+
newInstance.instantiableNestingLevel =
|
80
|
+
newInstance.instantiableNestingLevel === undefined ? 1 : newInstance.instantiableNestingLevel;
|
81
|
+
}
|
82
|
+
return newInstance;
|
83
|
+
}
|
84
|
+
TypeBase.cloneTypeAsInstantiable = cloneTypeAsInstantiable;
|
85
|
+
function cloneForTypeAlias(type, name, fullName, typeVarScopeId, typeParams, typeArgs) {
|
86
|
+
const typeClone = cloneType(type);
|
87
|
+
typeClone.typeAliasInfo = {
|
88
|
+
name,
|
89
|
+
fullName,
|
90
|
+
typeParameters: typeParams,
|
91
|
+
typeArguments: typeArgs,
|
92
|
+
typeVarScopeId,
|
93
|
+
};
|
94
|
+
return typeClone;
|
95
|
+
}
|
96
|
+
TypeBase.cloneForTypeAlias = cloneForTypeAlias;
|
97
|
+
function cloneForAnnotated(type) {
|
98
|
+
const typeClone = cloneType(type);
|
99
|
+
typeClone.flags |= 4 /* Annotated */;
|
100
|
+
return typeClone;
|
101
|
+
}
|
102
|
+
TypeBase.cloneForAnnotated = cloneForAnnotated;
|
103
|
+
function cloneForCondition(type, condition) {
|
104
|
+
// Handle the common case where there are no conditions. In this case,
|
105
|
+
// cloning isn't necessary.
|
106
|
+
if (type.condition === undefined && condition === undefined) {
|
107
|
+
return type;
|
108
|
+
}
|
109
|
+
const typeClone = cloneType(type);
|
110
|
+
typeClone.condition = condition;
|
111
|
+
return typeClone;
|
112
|
+
}
|
113
|
+
TypeBase.cloneForCondition = cloneForCondition;
|
114
|
+
function cloneForAmbiguousType(type) {
|
115
|
+
if (type.isAmbiguous) {
|
116
|
+
return type;
|
117
|
+
}
|
118
|
+
const typeClone = cloneType(type);
|
119
|
+
typeClone.isAmbiguous = true;
|
120
|
+
return typeClone;
|
121
|
+
}
|
122
|
+
TypeBase.cloneForAmbiguousType = cloneForAmbiguousType;
|
123
|
+
})(TypeBase = exports.TypeBase || (exports.TypeBase = {}));
|
124
|
+
var UnboundType;
|
125
|
+
(function (UnboundType) {
|
126
|
+
const _instance = {
|
127
|
+
category: 0 /* Unbound */,
|
128
|
+
flags: 1 /* Instantiable */ | 2 /* Instance */,
|
129
|
+
};
|
130
|
+
function create() {
|
131
|
+
// All Unbound objects are the same, so use a shared instance.
|
132
|
+
return _instance;
|
133
|
+
}
|
134
|
+
UnboundType.create = create;
|
135
|
+
})(UnboundType = exports.UnboundType || (exports.UnboundType = {}));
|
136
|
+
var UnknownType;
|
137
|
+
(function (UnknownType) {
|
138
|
+
const _instance = {
|
139
|
+
category: 1 /* Unknown */,
|
140
|
+
flags: 1 /* Instantiable */ | 2 /* Instance */,
|
141
|
+
isIncomplete: false,
|
142
|
+
};
|
143
|
+
const _incompleteInstance = {
|
144
|
+
category: 1 /* Unknown */,
|
145
|
+
flags: 1 /* Instantiable */ | 2 /* Instance */,
|
146
|
+
isIncomplete: true,
|
147
|
+
};
|
148
|
+
function create(isIncomplete = false) {
|
149
|
+
return isIncomplete ? _incompleteInstance : _instance;
|
150
|
+
}
|
151
|
+
UnknownType.create = create;
|
152
|
+
})(UnknownType = exports.UnknownType || (exports.UnknownType = {}));
|
153
|
+
var ModuleType;
|
154
|
+
(function (ModuleType) {
|
155
|
+
function create(moduleName, filePath, symbolTable) {
|
156
|
+
const newModuleType = {
|
157
|
+
category: 8 /* Module */,
|
158
|
+
fields: symbolTable || new Map(),
|
159
|
+
loaderFields: new Map(),
|
160
|
+
flags: 1 /* Instantiable */ | 1 /* Instantiable */,
|
161
|
+
moduleName,
|
162
|
+
filePath,
|
163
|
+
};
|
164
|
+
return newModuleType;
|
165
|
+
}
|
166
|
+
ModuleType.create = create;
|
167
|
+
function getField(moduleType, name) {
|
168
|
+
// Always look for the symbol in the module's fields before consulting
|
169
|
+
// the loader fields. The loader runs before the module, so its values
|
170
|
+
// will be overwritten by the module.
|
171
|
+
let symbol = moduleType.fields.get(name);
|
172
|
+
if (moduleType.loaderFields) {
|
173
|
+
if (!symbol) {
|
174
|
+
symbol = moduleType.loaderFields.get(name);
|
175
|
+
}
|
176
|
+
else if (symbol.isExternallyHidden()) {
|
177
|
+
// If the symbol is hidden when accessed via the module but is
|
178
|
+
// also accessible through a loader field, use the latter so it
|
179
|
+
// isn't flagged as an error.
|
180
|
+
const loaderSymbol = moduleType.loaderFields.get(name);
|
181
|
+
if (loaderSymbol && !loaderSymbol.isExternallyHidden()) {
|
182
|
+
symbol = loaderSymbol;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
186
|
+
return symbol;
|
187
|
+
}
|
188
|
+
ModuleType.getField = getField;
|
189
|
+
})(ModuleType = exports.ModuleType || (exports.ModuleType = {}));
|
190
|
+
var ClassType;
|
191
|
+
(function (ClassType) {
|
192
|
+
function createInstantiable(name, fullName, moduleName, filePath, flags, typeSourceId, declaredMetaclass, effectiveMetaclass, docString) {
|
193
|
+
const newClass = {
|
194
|
+
category: 7 /* Class */,
|
195
|
+
details: {
|
196
|
+
name,
|
197
|
+
fullName,
|
198
|
+
moduleName,
|
199
|
+
filePath,
|
200
|
+
flags,
|
201
|
+
typeSourceId,
|
202
|
+
baseClasses: [],
|
203
|
+
declaredMetaclass,
|
204
|
+
effectiveMetaclass,
|
205
|
+
mro: [],
|
206
|
+
fields: new Map(),
|
207
|
+
typeParameters: [],
|
208
|
+
docString,
|
209
|
+
},
|
210
|
+
flags: 1 /* Instantiable */,
|
211
|
+
};
|
212
|
+
return newClass;
|
213
|
+
}
|
214
|
+
ClassType.createInstantiable = createInstantiable;
|
215
|
+
function cloneAsInstance(type) {
|
216
|
+
if (TypeBase.isInstance(type)) {
|
217
|
+
return type;
|
218
|
+
}
|
219
|
+
const newInstance = TypeBase.cloneTypeAsInstance(type);
|
220
|
+
newInstance.flags &= ~8 /* SpecialForm */;
|
221
|
+
newInstance.includeSubclasses = true;
|
222
|
+
return newInstance;
|
223
|
+
}
|
224
|
+
ClassType.cloneAsInstance = cloneAsInstance;
|
225
|
+
function cloneAsInstantiable(objectType) {
|
226
|
+
return TypeBase.cloneTypeAsInstantiable(objectType);
|
227
|
+
}
|
228
|
+
ClassType.cloneAsInstantiable = cloneAsInstantiable;
|
229
|
+
function cloneForSpecialization(classType, typeArguments, isTypeArgumentExplicit, includeSubclasses = false, tupleTypeArguments, isEmptyContainer) {
|
230
|
+
const newClassType = TypeBase.cloneType(classType);
|
231
|
+
// Never should never appear as a type argument, so replace it with
|
232
|
+
newClassType.typeArguments = typeArguments
|
233
|
+
? typeArguments.map((t) => (isNever(t) && !t.isNoReturn ? UnknownType.create() : t))
|
234
|
+
: undefined;
|
235
|
+
newClassType.isTypeArgumentExplicit = isTypeArgumentExplicit;
|
236
|
+
if (includeSubclasses) {
|
237
|
+
newClassType.includeSubclasses = true;
|
238
|
+
}
|
239
|
+
newClassType.tupleTypeArguments = tupleTypeArguments
|
240
|
+
? tupleTypeArguments.map((t) => isNever(t.type) ? { type: UnknownType.create(), isUnbounded: t.isUnbounded } : t)
|
241
|
+
: undefined;
|
242
|
+
if (isEmptyContainer !== undefined) {
|
243
|
+
newClassType.isEmptyContainer = isEmptyContainer;
|
244
|
+
}
|
245
|
+
return newClassType;
|
246
|
+
}
|
247
|
+
ClassType.cloneForSpecialization = cloneForSpecialization;
|
248
|
+
function cloneWithLiteral(classType, value) {
|
249
|
+
const newClassType = TypeBase.cloneType(classType);
|
250
|
+
newClassType.literalValue = value;
|
251
|
+
return newClassType;
|
252
|
+
}
|
253
|
+
ClassType.cloneWithLiteral = cloneWithLiteral;
|
254
|
+
function cloneForTypingAlias(classType, aliasName) {
|
255
|
+
const newClassType = TypeBase.cloneType(classType);
|
256
|
+
newClassType.aliasName = aliasName;
|
257
|
+
return newClassType;
|
258
|
+
}
|
259
|
+
ClassType.cloneForTypingAlias = cloneForTypingAlias;
|
260
|
+
function cloneForNarrowedTypedDictEntries(classType, narrowedEntries) {
|
261
|
+
const newClassType = TypeBase.cloneType(classType);
|
262
|
+
newClassType.typedDictNarrowedEntries = narrowedEntries;
|
263
|
+
return newClassType;
|
264
|
+
}
|
265
|
+
ClassType.cloneForNarrowedTypedDictEntries = cloneForNarrowedTypedDictEntries;
|
266
|
+
function cloneWithNewTypeParameters(classType, typeParams) {
|
267
|
+
const newClassType = TypeBase.cloneType(classType);
|
268
|
+
newClassType.details = { ...newClassType.details };
|
269
|
+
newClassType.details.typeParameters = typeParams;
|
270
|
+
return newClassType;
|
271
|
+
}
|
272
|
+
ClassType.cloneWithNewTypeParameters = cloneWithNewTypeParameters;
|
273
|
+
function cloneForTypeGuard(classType, typeGuardType, isStrictTypeGuard) {
|
274
|
+
const newClassType = TypeBase.cloneType(classType);
|
275
|
+
newClassType.typeGuardType = typeGuardType;
|
276
|
+
newClassType.isStrictTypeGuard = isStrictTypeGuard;
|
277
|
+
return newClassType;
|
278
|
+
}
|
279
|
+
ClassType.cloneForTypeGuard = cloneForTypeGuard;
|
280
|
+
function cloneForSymbolTableUpdate(classType) {
|
281
|
+
const newClassType = TypeBase.cloneType(classType);
|
282
|
+
newClassType.details = { ...newClassType.details };
|
283
|
+
newClassType.details.fields = new Map(newClassType.details.fields);
|
284
|
+
newClassType.details.mro = [...newClassType.details.mro];
|
285
|
+
newClassType.details.mro[0] = cloneAsInstantiable(newClassType);
|
286
|
+
return newClassType;
|
287
|
+
}
|
288
|
+
ClassType.cloneForSymbolTableUpdate = cloneForSymbolTableUpdate;
|
289
|
+
function cloneForUnpacked(classType, isUnpacked = true) {
|
290
|
+
const newClassType = TypeBase.cloneType(classType);
|
291
|
+
newClassType.isUnpacked = isUnpacked;
|
292
|
+
return newClassType;
|
293
|
+
}
|
294
|
+
ClassType.cloneForUnpacked = cloneForUnpacked;
|
295
|
+
function isLiteralValueSame(type1, type2) {
|
296
|
+
if (type1.literalValue === undefined) {
|
297
|
+
return type2.literalValue === undefined;
|
298
|
+
}
|
299
|
+
else if (type2.literalValue === undefined) {
|
300
|
+
return false;
|
301
|
+
}
|
302
|
+
if (type1.literalValue instanceof EnumLiteral) {
|
303
|
+
if (type2.literalValue instanceof EnumLiteral) {
|
304
|
+
return type1.literalValue.itemName === type2.literalValue.itemName;
|
305
|
+
}
|
306
|
+
return false;
|
307
|
+
}
|
308
|
+
return type1.literalValue === type2.literalValue;
|
309
|
+
}
|
310
|
+
ClassType.isLiteralValueSame = isLiteralValueSame;
|
311
|
+
// Is the class generic but not specialized?
|
312
|
+
function isUnspecialized(classType) {
|
313
|
+
return classType.details.typeParameters.length > 0 && classType.typeArguments === undefined;
|
314
|
+
}
|
315
|
+
ClassType.isUnspecialized = isUnspecialized;
|
316
|
+
function isSpecialBuiltIn(classType, className) {
|
317
|
+
if (!(classType.details.flags & 2 /* SpecialBuiltIn */) && !classType.aliasName) {
|
318
|
+
return false;
|
319
|
+
}
|
320
|
+
if (className !== undefined) {
|
321
|
+
return classType.details.name === className;
|
322
|
+
}
|
323
|
+
return true;
|
324
|
+
}
|
325
|
+
ClassType.isSpecialBuiltIn = isSpecialBuiltIn;
|
326
|
+
function isBuiltIn(classType, className) {
|
327
|
+
if (!(classType.details.flags & 1 /* BuiltInClass */)) {
|
328
|
+
return false;
|
329
|
+
}
|
330
|
+
if (className !== undefined) {
|
331
|
+
const classArray = Array.isArray(className) ? className : [className];
|
332
|
+
return (classArray.some((name) => name === classType.details.name) ||
|
333
|
+
classArray.some((name) => name === classType.aliasName));
|
334
|
+
}
|
335
|
+
return true;
|
336
|
+
}
|
337
|
+
ClassType.isBuiltIn = isBuiltIn;
|
338
|
+
function derivesFromAnyOrUnknown(classType) {
|
339
|
+
return classType.details.mro.some((mroClass) => !isClass(mroClass));
|
340
|
+
}
|
341
|
+
ClassType.derivesFromAnyOrUnknown = derivesFromAnyOrUnknown;
|
342
|
+
function supportsAbstractMethods(classType) {
|
343
|
+
return !!(classType.details.flags & 512 /* SupportsAbstractMethods */);
|
344
|
+
}
|
345
|
+
ClassType.supportsAbstractMethods = supportsAbstractMethods;
|
346
|
+
function isDataClass(classType) {
|
347
|
+
return !!(classType.details.flags & 4 /* DataClass */);
|
348
|
+
}
|
349
|
+
ClassType.isDataClass = isDataClass;
|
350
|
+
function isSkipSynthesizedDataClassInit(classType) {
|
351
|
+
return !!(classType.details.flags & 16 /* SkipSynthesizedDataClassInit */);
|
352
|
+
}
|
353
|
+
ClassType.isSkipSynthesizedDataClassInit = isSkipSynthesizedDataClassInit;
|
354
|
+
function isSkipSynthesizedDataClassEq(classType) {
|
355
|
+
return !!(classType.details.flags & 32 /* SkipSynthesizedDataClassEq */);
|
356
|
+
}
|
357
|
+
ClassType.isSkipSynthesizedDataClassEq = isSkipSynthesizedDataClassEq;
|
358
|
+
function isFrozenDataClass(classType) {
|
359
|
+
return !!(classType.details.flags & 8 /* FrozenDataClass */);
|
360
|
+
}
|
361
|
+
ClassType.isFrozenDataClass = isFrozenDataClass;
|
362
|
+
function isSynthesizedDataclassOrder(classType) {
|
363
|
+
return !!(classType.details.flags & 64 /* SynthesizedDataClassOrder */);
|
364
|
+
}
|
365
|
+
ClassType.isSynthesizedDataclassOrder = isSynthesizedDataclassOrder;
|
366
|
+
function isDataClassKeywordOnlyParams(classType) {
|
367
|
+
return !!(classType.details.flags & 2097152 /* DataClassKeywordOnlyParams */);
|
368
|
+
}
|
369
|
+
ClassType.isDataClassKeywordOnlyParams = isDataClassKeywordOnlyParams;
|
370
|
+
function isGeneratedDataClassSlots(classType) {
|
371
|
+
return !!(classType.details.flags & 33554432 /* GenerateDataClassSlots */);
|
372
|
+
}
|
373
|
+
ClassType.isGeneratedDataClassSlots = isGeneratedDataClassSlots;
|
374
|
+
function isSynthesizeDataClassUnsafeHash(classType) {
|
375
|
+
return !!(classType.details.flags & 67108864 /* SynthesizeDataClassUnsafeHash */);
|
376
|
+
}
|
377
|
+
ClassType.isSynthesizeDataClassUnsafeHash = isSynthesizeDataClassUnsafeHash;
|
378
|
+
function isTypedDictClass(classType) {
|
379
|
+
return !!(classType.details.flags & 128 /* TypedDictClass */);
|
380
|
+
}
|
381
|
+
ClassType.isTypedDictClass = isTypedDictClass;
|
382
|
+
function isCanOmitDictValues(classType) {
|
383
|
+
return !!(classType.details.flags & 256 /* CanOmitDictValues */);
|
384
|
+
}
|
385
|
+
ClassType.isCanOmitDictValues = isCanOmitDictValues;
|
386
|
+
function isEnumClass(classType) {
|
387
|
+
return !!(classType.details.flags & 1048576 /* EnumClass */);
|
388
|
+
}
|
389
|
+
ClassType.isEnumClass = isEnumClass;
|
390
|
+
function isPropertyClass(classType) {
|
391
|
+
return !!(classType.details.flags & 2048 /* PropertyClass */);
|
392
|
+
}
|
393
|
+
ClassType.isPropertyClass = isPropertyClass;
|
394
|
+
function isClassProperty(classType) {
|
395
|
+
return !!(classType.details.flags & 4194304 /* ClassProperty */);
|
396
|
+
}
|
397
|
+
ClassType.isClassProperty = isClassProperty;
|
398
|
+
function isFinal(classType) {
|
399
|
+
return !!(classType.details.flags & 4096 /* Final */);
|
400
|
+
}
|
401
|
+
ClassType.isFinal = isFinal;
|
402
|
+
function isProtocolClass(classType) {
|
403
|
+
return !!(classType.details.flags & 8192 /* ProtocolClass */);
|
404
|
+
}
|
405
|
+
ClassType.isProtocolClass = isProtocolClass;
|
406
|
+
function isDefinedInStub(classType) {
|
407
|
+
return !!(classType.details.flags & 8388608 /* DefinedInStub */);
|
408
|
+
}
|
409
|
+
ClassType.isDefinedInStub = isDefinedInStub;
|
410
|
+
function isPseudoGenericClass(classType) {
|
411
|
+
return !!(classType.details.flags & 16384 /* PseudoGenericClass */);
|
412
|
+
}
|
413
|
+
ClassType.isPseudoGenericClass = isPseudoGenericClass;
|
414
|
+
function getDataClassEntries(classType) {
|
415
|
+
return classType.details.dataClassEntries || [];
|
416
|
+
}
|
417
|
+
ClassType.getDataClassEntries = getDataClassEntries;
|
418
|
+
function isRuntimeCheckable(classType) {
|
419
|
+
return !!(classType.details.flags & 32768 /* RuntimeCheckable */);
|
420
|
+
}
|
421
|
+
ClassType.isRuntimeCheckable = isRuntimeCheckable;
|
422
|
+
function isTypingExtensionClass(classType) {
|
423
|
+
return !!(classType.details.flags & 65536 /* TypingExtensionClass */);
|
424
|
+
}
|
425
|
+
ClassType.isTypingExtensionClass = isTypingExtensionClass;
|
426
|
+
function isPartiallyEvaluated(classType) {
|
427
|
+
return !!(classType.details.flags & 131072 /* PartiallyEvaluated */);
|
428
|
+
}
|
429
|
+
ClassType.isPartiallyEvaluated = isPartiallyEvaluated;
|
430
|
+
function hasCustomClassGetItem(classType) {
|
431
|
+
return !!(classType.details.flags & 262144 /* HasCustomClassGetItem */);
|
432
|
+
}
|
433
|
+
ClassType.hasCustomClassGetItem = hasCustomClassGetItem;
|
434
|
+
function isTupleClass(classType) {
|
435
|
+
return !!(classType.details.flags & 524288 /* TupleClass */);
|
436
|
+
}
|
437
|
+
ClassType.isTupleClass = isTupleClass;
|
438
|
+
function isReadOnlyInstanceVariables(classType) {
|
439
|
+
return !!(classType.details.flags & 16777216 /* ReadOnlyInstanceVariables */);
|
440
|
+
}
|
441
|
+
ClassType.isReadOnlyInstanceVariables = isReadOnlyInstanceVariables;
|
442
|
+
function getTypeParameters(classType) {
|
443
|
+
return classType.details.typeParameters;
|
444
|
+
}
|
445
|
+
ClassType.getTypeParameters = getTypeParameters;
|
446
|
+
function hasUnknownBaseClass(classType) {
|
447
|
+
return classType.details.mro.some((baseClass) => isAnyOrUnknown(baseClass));
|
448
|
+
}
|
449
|
+
ClassType.hasUnknownBaseClass = hasUnknownBaseClass;
|
450
|
+
// Similar to isPartiallyEvaluated except that it also looks at all of the
|
451
|
+
// classes in the MRO list for this class to see if any of them are still
|
452
|
+
// partially evaluated.
|
453
|
+
function isHierarchyPartiallyEvaluated(classType) {
|
454
|
+
return (ClassType.isPartiallyEvaluated(classType) ||
|
455
|
+
classType.details.mro.some((mroClass) => isClass(mroClass) && ClassType.isPartiallyEvaluated(mroClass)));
|
456
|
+
}
|
457
|
+
ClassType.isHierarchyPartiallyEvaluated = isHierarchyPartiallyEvaluated;
|
458
|
+
// Same as isSame except that it doesn't compare type arguments.
|
459
|
+
function isSameGenericClass(classType, type2, recursionCount = 0) {
|
460
|
+
if (recursionCount > exports.maxTypeRecursionCount) {
|
461
|
+
return true;
|
462
|
+
}
|
463
|
+
recursionCount++;
|
464
|
+
// If the class details match, it's definitely the same class.
|
465
|
+
if (classType.details === type2.details) {
|
466
|
+
return true;
|
467
|
+
}
|
468
|
+
// If either or both have aliases (e.g. List -> list), use the
|
469
|
+
// aliases for comparison purposes.
|
470
|
+
const class1Details = classType.details;
|
471
|
+
const class2Details = type2.details;
|
472
|
+
if (class1Details === class2Details) {
|
473
|
+
return true;
|
474
|
+
}
|
475
|
+
// Compare most of the details fields. We intentionally skip the isAbstractClass
|
476
|
+
// flag because it gets set dynamically.
|
477
|
+
if (class1Details.fullName !== class2Details.fullName ||
|
478
|
+
class1Details.flags !== class2Details.flags ||
|
479
|
+
class1Details.typeSourceId !== class2Details.typeSourceId ||
|
480
|
+
class1Details.baseClasses.length !== class2Details.baseClasses.length ||
|
481
|
+
class1Details.typeParameters.length !== class2Details.typeParameters.length) {
|
482
|
+
return false;
|
483
|
+
}
|
484
|
+
// Special-case NamedTuple and Tuple classes because we rewrite the base classes
|
485
|
+
// in these cases.
|
486
|
+
if (ClassType.isBuiltIn(classType, 'NamedTuple') && ClassType.isBuiltIn(type2, 'NamedTuple')) {
|
487
|
+
return true;
|
488
|
+
}
|
489
|
+
if (ClassType.isBuiltIn(classType, 'tuple') && ClassType.isBuiltIn(type2, 'tuple')) {
|
490
|
+
return true;
|
491
|
+
}
|
492
|
+
// Make sure the base classes match.
|
493
|
+
for (let i = 0; i < class1Details.baseClasses.length; i++) {
|
494
|
+
if (!isTypeSame(class1Details.baseClasses[i], class2Details.baseClasses[i],
|
495
|
+
/* ignorePseudoGeneric */ true,
|
496
|
+
/* ignoreTypeFlags */ undefined, recursionCount)) {
|
497
|
+
return false;
|
498
|
+
}
|
499
|
+
}
|
500
|
+
if (class1Details.declaredMetaclass || class2Details.declaredMetaclass) {
|
501
|
+
if (!class1Details.declaredMetaclass ||
|
502
|
+
!class2Details.declaredMetaclass ||
|
503
|
+
!isTypeSame(class1Details.declaredMetaclass, class2Details.declaredMetaclass,
|
504
|
+
/* ignorePseudoGeneric */ true,
|
505
|
+
/* ignoreTypeFlags */ undefined, recursionCount)) {
|
506
|
+
return false;
|
507
|
+
}
|
508
|
+
}
|
509
|
+
for (let i = 0; i < class1Details.typeParameters.length; i++) {
|
510
|
+
if (!isTypeSame(class1Details.typeParameters[i], class2Details.typeParameters[i],
|
511
|
+
/* ignorePseudoGeneric */ true,
|
512
|
+
/* ignoreTypeFlags */ undefined, recursionCount)) {
|
513
|
+
return false;
|
514
|
+
}
|
515
|
+
}
|
516
|
+
return true;
|
517
|
+
}
|
518
|
+
ClassType.isSameGenericClass = isSameGenericClass;
|
519
|
+
// Determines whether this is a subclass (derived class)
|
520
|
+
// of the specified class. If the caller passes an empty
|
521
|
+
// array to inheritanceChain, it will be filled in by
|
522
|
+
// the call to include the chain of inherited classes starting
|
523
|
+
// with type2 and ending with this type.
|
524
|
+
function isDerivedFrom(subclassType, parentClassType, inheritanceChain) {
|
525
|
+
// Is it the exact same class?
|
526
|
+
if (isSameGenericClass(subclassType, parentClassType)) {
|
527
|
+
if (inheritanceChain) {
|
528
|
+
inheritanceChain.push(subclassType);
|
529
|
+
}
|
530
|
+
return true;
|
531
|
+
}
|
532
|
+
// Handle built-in types like 'dict' and 'list', which are all
|
533
|
+
// subclasses of object even though they are not explicitly declared
|
534
|
+
// that way.
|
535
|
+
if (isBuiltIn(subclassType) && isBuiltIn(parentClassType, 'object')) {
|
536
|
+
if (inheritanceChain) {
|
537
|
+
inheritanceChain.push(parentClassType);
|
538
|
+
}
|
539
|
+
return true;
|
540
|
+
}
|
541
|
+
for (const baseClass of subclassType.details.baseClasses) {
|
542
|
+
if (isInstantiableClass(baseClass)) {
|
543
|
+
if (isDerivedFrom(baseClass, parentClassType, inheritanceChain)) {
|
544
|
+
if (inheritanceChain) {
|
545
|
+
inheritanceChain.push(subclassType);
|
546
|
+
}
|
547
|
+
return true;
|
548
|
+
}
|
549
|
+
}
|
550
|
+
else if (isAnyOrUnknown(baseClass)) {
|
551
|
+
if (inheritanceChain) {
|
552
|
+
inheritanceChain.push(UnknownType.create());
|
553
|
+
}
|
554
|
+
return true;
|
555
|
+
}
|
556
|
+
}
|
557
|
+
return false;
|
558
|
+
}
|
559
|
+
ClassType.isDerivedFrom = isDerivedFrom;
|
560
|
+
})(ClassType = exports.ClassType || (exports.ClassType = {}));
|
561
|
+
var FunctionType;
|
562
|
+
(function (FunctionType) {
|
563
|
+
function createInstance(name, fullName, moduleName, functionFlags, docString) {
|
564
|
+
return create(name, fullName, moduleName, functionFlags, 2 /* Instance */, docString);
|
565
|
+
}
|
566
|
+
FunctionType.createInstance = createInstance;
|
567
|
+
function createInstantiable(functionFlags, docString) {
|
568
|
+
return create('', '', '', functionFlags, 1 /* Instantiable */, docString);
|
569
|
+
}
|
570
|
+
FunctionType.createInstantiable = createInstantiable;
|
571
|
+
function createSynthesizedInstance(name, additionalFlags = 0 /* None */) {
|
572
|
+
return create(name, '', '', additionalFlags | 64 /* SynthesizedMethod */, 2 /* Instance */);
|
573
|
+
}
|
574
|
+
FunctionType.createSynthesizedInstance = createSynthesizedInstance;
|
575
|
+
function create(name, fullName, moduleName, functionFlags, typeFlags, docString) {
|
576
|
+
const newFunctionType = {
|
577
|
+
category: 5 /* Function */,
|
578
|
+
details: {
|
579
|
+
name,
|
580
|
+
fullName,
|
581
|
+
moduleName,
|
582
|
+
flags: functionFlags,
|
583
|
+
parameters: [],
|
584
|
+
docString,
|
585
|
+
},
|
586
|
+
flags: typeFlags,
|
587
|
+
};
|
588
|
+
return newFunctionType;
|
589
|
+
}
|
590
|
+
// Creates a deep copy of the function type, including a fresh
|
591
|
+
// version of _functionDetails.
|
592
|
+
function clone(type, stripFirstParam = false, boundToType, boundTypeVarScopeId) {
|
593
|
+
var _a;
|
594
|
+
const newFunction = create(type.details.name, type.details.fullName, type.details.moduleName, type.details.flags, type.flags, type.details.docString);
|
595
|
+
newFunction.details = { ...type.details };
|
596
|
+
newFunction.boundToType = boundToType;
|
597
|
+
newFunction.preBoundFlags = newFunction.details.flags;
|
598
|
+
if (stripFirstParam) {
|
599
|
+
if (type.details.parameters.length > 0 &&
|
600
|
+
type.details.parameters[0].category === 0 /* Simple */) {
|
601
|
+
if (type.details.parameters.length > 0 && !type.details.parameters[0].isTypeInferred) {
|
602
|
+
// Stash away the effective type of the first parameter if it
|
603
|
+
// wasn't synthesized.
|
604
|
+
newFunction.strippedFirstParamType = getEffectiveParameterType(type, 0);
|
605
|
+
}
|
606
|
+
newFunction.details.parameters = type.details.parameters.slice(1);
|
607
|
+
}
|
608
|
+
else {
|
609
|
+
stripFirstParam = false;
|
610
|
+
}
|
611
|
+
// If we strip off the first parameter, this is no longer an
|
612
|
+
// instance method or class method.
|
613
|
+
newFunction.details.flags &= ~(1 /* ConstructorMethod */ | 2 /* ClassMethod */);
|
614
|
+
newFunction.details.flags |= 4 /* StaticMethod */;
|
615
|
+
}
|
616
|
+
if (type.typeAliasInfo !== undefined) {
|
617
|
+
newFunction.typeAliasInfo = type.typeAliasInfo;
|
618
|
+
}
|
619
|
+
if (type.specializedTypes) {
|
620
|
+
newFunction.specializedTypes = {
|
621
|
+
parameterTypes: stripFirstParam
|
622
|
+
? type.specializedTypes.parameterTypes.slice(1)
|
623
|
+
: type.specializedTypes.parameterTypes,
|
624
|
+
parameterDefaultArgs: stripFirstParam
|
625
|
+
? (_a = type.specializedTypes.parameterDefaultArgs) === null || _a === void 0 ? void 0 : _a.slice(1)
|
626
|
+
: type.specializedTypes.parameterDefaultArgs,
|
627
|
+
returnType: type.specializedTypes.returnType,
|
628
|
+
};
|
629
|
+
}
|
630
|
+
newFunction.inferredReturnType = type.inferredReturnType;
|
631
|
+
newFunction.boundTypeVarScopeId = boundTypeVarScopeId;
|
632
|
+
return newFunction;
|
633
|
+
}
|
634
|
+
FunctionType.clone = clone;
|
635
|
+
function cloneAsInstance(type) {
|
636
|
+
const newInstance = TypeBase.cloneTypeAsInstance(type);
|
637
|
+
newInstance.flags &= ~8 /* SpecialForm */;
|
638
|
+
return newInstance;
|
639
|
+
}
|
640
|
+
FunctionType.cloneAsInstance = cloneAsInstance;
|
641
|
+
function cloneAsInstantiable(type) {
|
642
|
+
const newInstance = TypeBase.cloneTypeAsInstantiable(type);
|
643
|
+
newInstance.flags &= ~8 /* SpecialForm */;
|
644
|
+
return newInstance;
|
645
|
+
}
|
646
|
+
FunctionType.cloneAsInstantiable = cloneAsInstantiable;
|
647
|
+
// Creates a shallow copy of the function type with new
|
648
|
+
// specialized types. The clone shares the _functionDetails
|
649
|
+
// with the object being cloned.
|
650
|
+
function cloneForSpecialization(type, specializedTypes, specializedInferredReturnType) {
|
651
|
+
const newFunction = create(type.details.name, type.details.fullName, type.details.moduleName, type.details.flags, type.flags, type.details.docString);
|
652
|
+
newFunction.details = type.details;
|
653
|
+
(0, debug_1.assert)(specializedTypes.parameterTypes.length === type.details.parameters.length);
|
654
|
+
if (specializedTypes.parameterDefaultArgs) {
|
655
|
+
(0, debug_1.assert)(specializedTypes.parameterDefaultArgs.length === type.details.parameters.length);
|
656
|
+
}
|
657
|
+
newFunction.specializedTypes = specializedTypes;
|
658
|
+
if (specializedInferredReturnType) {
|
659
|
+
newFunction.inferredReturnType = specializedInferredReturnType;
|
660
|
+
}
|
661
|
+
return newFunction;
|
662
|
+
}
|
663
|
+
FunctionType.cloneForSpecialization = cloneForSpecialization;
|
664
|
+
// Creates a new function based on the parameters of another function.
|
665
|
+
function cloneForParamSpec(type, paramSpecValue) {
|
666
|
+
const newFunction = create(type.details.name, type.details.fullName, type.details.moduleName, type.details.flags, type.flags, type.details.docString);
|
667
|
+
// Make a shallow clone of the details.
|
668
|
+
newFunction.details = { ...type.details };
|
669
|
+
// The clone should no longer have a parameter specification
|
670
|
+
// since we're replacing it.
|
671
|
+
delete newFunction.details.paramSpec;
|
672
|
+
if (paramSpecValue) {
|
673
|
+
newFunction.details.parameters = [
|
674
|
+
...type.details.parameters,
|
675
|
+
...paramSpecValue.parameters.map((specEntry) => {
|
676
|
+
return {
|
677
|
+
category: specEntry.category,
|
678
|
+
name: specEntry.name,
|
679
|
+
hasDefault: specEntry.hasDefault,
|
680
|
+
isNameSynthesized: specEntry.isNameSynthesized,
|
681
|
+
hasDeclaredType: true,
|
682
|
+
type: specEntry.type,
|
683
|
+
};
|
684
|
+
}),
|
685
|
+
];
|
686
|
+
if (!newFunction.details.docString) {
|
687
|
+
newFunction.details.docString = paramSpecValue.docString;
|
688
|
+
}
|
689
|
+
newFunction.details.flags =
|
690
|
+
(paramSpecValue.flags &
|
691
|
+
(2 /* ClassMethod */ |
|
692
|
+
4 /* StaticMethod */ |
|
693
|
+
1 /* ConstructorMethod */ |
|
694
|
+
32768 /* SkipArgsKwargsCompatibilityCheck */)) |
|
695
|
+
64 /* SynthesizedMethod */;
|
696
|
+
if (FunctionType.isParamSpecValue(type)) {
|
697
|
+
newFunction.details.flags |= 65536 /* ParamSpecValue */;
|
698
|
+
}
|
699
|
+
// Update the specialized parameter types as well.
|
700
|
+
if (type.specializedTypes) {
|
701
|
+
newFunction.specializedTypes = {
|
702
|
+
parameterTypes: [...type.specializedTypes.parameterTypes],
|
703
|
+
returnType: type.specializedTypes.returnType,
|
704
|
+
};
|
705
|
+
if (type.specializedTypes.parameterDefaultArgs) {
|
706
|
+
newFunction.specializedTypes.parameterDefaultArgs = [...type.specializedTypes.parameterDefaultArgs];
|
707
|
+
}
|
708
|
+
paramSpecValue.parameters.forEach((paramInfo) => {
|
709
|
+
newFunction.specializedTypes.parameterTypes.push(paramInfo.type);
|
710
|
+
if (newFunction.specializedTypes.parameterDefaultArgs) {
|
711
|
+
// Assume that the parameters introduced via paramSpec have no specialized
|
712
|
+
// default arg types. Fall back on the original default arg type in this case.
|
713
|
+
newFunction.specializedTypes.parameterDefaultArgs.push(undefined);
|
714
|
+
}
|
715
|
+
});
|
716
|
+
}
|
717
|
+
newFunction.details.paramSpec = paramSpecValue.paramSpec;
|
718
|
+
}
|
719
|
+
return newFunction;
|
720
|
+
}
|
721
|
+
FunctionType.cloneForParamSpec = cloneForParamSpec;
|
722
|
+
function cloneWithNewFlags(type, flags) {
|
723
|
+
const newFunction = TypeBase.cloneType(type);
|
724
|
+
// Make a shallow clone of the details.
|
725
|
+
newFunction.details = { ...type.details };
|
726
|
+
newFunction.details.flags = flags;
|
727
|
+
return newFunction;
|
728
|
+
}
|
729
|
+
FunctionType.cloneWithNewFlags = cloneWithNewFlags;
|
730
|
+
function cloneForParamSpecApplication(type, paramSpecValue) {
|
731
|
+
const newFunction = TypeBase.cloneType(type);
|
732
|
+
// Make a shallow clone of the details.
|
733
|
+
newFunction.details = { ...type.details };
|
734
|
+
// Remove the last two parameters, which are the *args and **kwargs.
|
735
|
+
newFunction.details.parameters = newFunction.details.parameters.slice(0, newFunction.details.parameters.length - 2);
|
736
|
+
// If there is a position-only separator in the captured param spec signature,
|
737
|
+
// remove the position-only separator in the existing signature. Otherwise,
|
738
|
+
// we'll end up with redundant position-only separators.
|
739
|
+
if (paramSpecValue.parameters.some((entry) => entry.category === 0 /* Simple */ && !entry.name)) {
|
740
|
+
if (newFunction.details.parameters.length > 0) {
|
741
|
+
const lastParam = newFunction.details.parameters[newFunction.details.parameters.length - 1];
|
742
|
+
if (lastParam.category === 0 /* Simple */ && !lastParam.name) {
|
743
|
+
newFunction.details.parameters.pop();
|
744
|
+
}
|
745
|
+
}
|
746
|
+
}
|
747
|
+
paramSpecValue.parameters.forEach((specEntry) => {
|
748
|
+
newFunction.details.parameters.push({
|
749
|
+
category: specEntry.category,
|
750
|
+
name: specEntry.name,
|
751
|
+
hasDefault: specEntry.hasDefault,
|
752
|
+
isNameSynthesized: specEntry.isNameSynthesized,
|
753
|
+
hasDeclaredType: true,
|
754
|
+
type: specEntry.type,
|
755
|
+
});
|
756
|
+
});
|
757
|
+
newFunction.details.paramSpec = paramSpecValue.paramSpec;
|
758
|
+
if (!newFunction.details.docString) {
|
759
|
+
newFunction.details.docString = paramSpecValue.docString;
|
760
|
+
}
|
761
|
+
return newFunction;
|
762
|
+
}
|
763
|
+
FunctionType.cloneForParamSpecApplication = cloneForParamSpecApplication;
|
764
|
+
function cloneRemoveParamSpecVariadics(type, paramSpec) {
|
765
|
+
const newFunction = create(type.details.name, type.details.fullName, type.details.moduleName, type.details.flags, type.flags, type.details.docString);
|
766
|
+
// Make a shallow clone of the details.
|
767
|
+
newFunction.details = { ...type.details };
|
768
|
+
// Remove the last two parameters, which are the *args and **kwargs.
|
769
|
+
newFunction.details.parameters = newFunction.details.parameters.slice(0, newFunction.details.parameters.length - 2);
|
770
|
+
if (type.specializedTypes) {
|
771
|
+
newFunction.specializedTypes = { ...type.specializedTypes };
|
772
|
+
newFunction.specializedTypes.parameterTypes = newFunction.specializedTypes.parameterTypes.slice(0, newFunction.specializedTypes.parameterTypes.length - 2);
|
773
|
+
if (newFunction.specializedTypes.parameterDefaultArgs) {
|
774
|
+
newFunction.specializedTypes.parameterDefaultArgs =
|
775
|
+
newFunction.specializedTypes.parameterDefaultArgs.slice(0, newFunction.specializedTypes.parameterDefaultArgs.length - 2);
|
776
|
+
}
|
777
|
+
}
|
778
|
+
if (!newFunction.details.paramSpec) {
|
779
|
+
newFunction.details.paramSpec = paramSpec;
|
780
|
+
}
|
781
|
+
return newFunction;
|
782
|
+
}
|
783
|
+
FunctionType.cloneRemoveParamSpecVariadics = cloneRemoveParamSpecVariadics;
|
784
|
+
function addDefaultParameters(functionType, useUnknown = false) {
|
785
|
+
getDefaultParameters(useUnknown).forEach((param) => {
|
786
|
+
FunctionType.addParameter(functionType, param);
|
787
|
+
});
|
788
|
+
}
|
789
|
+
FunctionType.addDefaultParameters = addDefaultParameters;
|
790
|
+
function getDefaultParameters(useUnknown = false) {
|
791
|
+
return [
|
792
|
+
{
|
793
|
+
category: 1 /* VarArgList */,
|
794
|
+
name: 'args',
|
795
|
+
type: useUnknown ? UnknownType.create() : AnyType.create(),
|
796
|
+
hasDeclaredType: !useUnknown,
|
797
|
+
},
|
798
|
+
{
|
799
|
+
category: 2 /* VarArgDictionary */,
|
800
|
+
name: 'kwargs',
|
801
|
+
type: useUnknown ? UnknownType.create() : AnyType.create(),
|
802
|
+
hasDeclaredType: !useUnknown,
|
803
|
+
},
|
804
|
+
];
|
805
|
+
}
|
806
|
+
FunctionType.getDefaultParameters = getDefaultParameters;
|
807
|
+
// Indicates whether the input signature consists of (*args: Any, **kwargs: Any).
|
808
|
+
function hasDefaultParameters(functionType) {
|
809
|
+
let sawArgs = false;
|
810
|
+
let sawKwargs = false;
|
811
|
+
for (let i = 0; i < functionType.details.parameters.length; i++) {
|
812
|
+
const param = functionType.details.parameters[i];
|
813
|
+
// Ignore nameless separator parameters.
|
814
|
+
if (!param.name) {
|
815
|
+
continue;
|
816
|
+
}
|
817
|
+
if (param.category === 0 /* Simple */) {
|
818
|
+
return false;
|
819
|
+
}
|
820
|
+
else if (param.category === 1 /* VarArgList */) {
|
821
|
+
sawArgs = true;
|
822
|
+
}
|
823
|
+
else if (param.category === 2 /* VarArgDictionary */) {
|
824
|
+
sawKwargs = true;
|
825
|
+
}
|
826
|
+
if (!isAnyOrUnknown(FunctionType.getEffectiveParameterType(functionType, i))) {
|
827
|
+
return false;
|
828
|
+
}
|
829
|
+
}
|
830
|
+
return sawArgs && sawKwargs;
|
831
|
+
}
|
832
|
+
FunctionType.hasDefaultParameters = hasDefaultParameters;
|
833
|
+
function isInstanceMethod(type) {
|
834
|
+
return ((type.details.flags &
|
835
|
+
(1 /* ConstructorMethod */ |
|
836
|
+
4 /* StaticMethod */ |
|
837
|
+
2 /* ClassMethod */)) ===
|
838
|
+
0);
|
839
|
+
}
|
840
|
+
FunctionType.isInstanceMethod = isInstanceMethod;
|
841
|
+
function isConstructorMethod(type) {
|
842
|
+
return (type.details.flags & 1 /* ConstructorMethod */) !== 0;
|
843
|
+
}
|
844
|
+
FunctionType.isConstructorMethod = isConstructorMethod;
|
845
|
+
function isStaticMethod(type) {
|
846
|
+
return (type.details.flags & 4 /* StaticMethod */) !== 0;
|
847
|
+
}
|
848
|
+
FunctionType.isStaticMethod = isStaticMethod;
|
849
|
+
function isClassMethod(type) {
|
850
|
+
return (type.details.flags & 2 /* ClassMethod */) !== 0;
|
851
|
+
}
|
852
|
+
FunctionType.isClassMethod = isClassMethod;
|
853
|
+
function isAbstractMethod(type) {
|
854
|
+
return (type.details.flags & 8 /* AbstractMethod */) !== 0;
|
855
|
+
}
|
856
|
+
FunctionType.isAbstractMethod = isAbstractMethod;
|
857
|
+
function isGenerator(type) {
|
858
|
+
return (type.details.flags & 16 /* Generator */) !== 0;
|
859
|
+
}
|
860
|
+
FunctionType.isGenerator = isGenerator;
|
861
|
+
function isSynthesizedMethod(type) {
|
862
|
+
return (type.details.flags & 64 /* SynthesizedMethod */) !== 0;
|
863
|
+
}
|
864
|
+
FunctionType.isSynthesizedMethod = isSynthesizedMethod;
|
865
|
+
function isSkipConstructorCheck(type) {
|
866
|
+
return (type.details.flags & 128 /* SkipConstructorCheck */) !== 0;
|
867
|
+
}
|
868
|
+
FunctionType.isSkipConstructorCheck = isSkipConstructorCheck;
|
869
|
+
function isOverloaded(type) {
|
870
|
+
return (type.details.flags & 256 /* Overloaded */) !== 0;
|
871
|
+
}
|
872
|
+
FunctionType.isOverloaded = isOverloaded;
|
873
|
+
function isDefaultParameterCheckDisabled(type) {
|
874
|
+
return (type.details.flags & 32 /* DisableDefaultChecks */) !== 0;
|
875
|
+
}
|
876
|
+
FunctionType.isDefaultParameterCheckDisabled = isDefaultParameterCheckDisabled;
|
877
|
+
function isAsync(type) {
|
878
|
+
return (type.details.flags & 512 /* Async */) !== 0;
|
879
|
+
}
|
880
|
+
FunctionType.isAsync = isAsync;
|
881
|
+
function isWrapReturnTypeInAwait(type) {
|
882
|
+
return (type.details.flags & 1024 /* WrapReturnTypeInAwait */) !== 0;
|
883
|
+
}
|
884
|
+
FunctionType.isWrapReturnTypeInAwait = isWrapReturnTypeInAwait;
|
885
|
+
function isStubDefinition(type) {
|
886
|
+
return (type.details.flags & 2048 /* StubDefinition */) !== 0;
|
887
|
+
}
|
888
|
+
FunctionType.isStubDefinition = isStubDefinition;
|
889
|
+
function isPyTypedDefinition(type) {
|
890
|
+
return (type.details.flags & 4096 /* PyTypedDefinition */) !== 0;
|
891
|
+
}
|
892
|
+
FunctionType.isPyTypedDefinition = isPyTypedDefinition;
|
893
|
+
function isFinal(type) {
|
894
|
+
return (type.details.flags & 8192 /* Final */) !== 0;
|
895
|
+
}
|
896
|
+
FunctionType.isFinal = isFinal;
|
897
|
+
function hasUnannotatedParams(type) {
|
898
|
+
return (type.details.flags & 16384 /* UnannotatedParams */) !== 0;
|
899
|
+
}
|
900
|
+
FunctionType.hasUnannotatedParams = hasUnannotatedParams;
|
901
|
+
function shouldSkipArgsKwargsCompatibilityCheck(type) {
|
902
|
+
return (type.details.flags & 32768 /* SkipArgsKwargsCompatibilityCheck */) !== 0;
|
903
|
+
}
|
904
|
+
FunctionType.shouldSkipArgsKwargsCompatibilityCheck = shouldSkipArgsKwargsCompatibilityCheck;
|
905
|
+
function isParamSpecValue(type) {
|
906
|
+
return (type.details.flags & 65536 /* ParamSpecValue */) !== 0;
|
907
|
+
}
|
908
|
+
FunctionType.isParamSpecValue = isParamSpecValue;
|
909
|
+
function isPartiallyEvaluated(type) {
|
910
|
+
return !!(type.details.flags & 131072 /* PartiallyEvaluated */);
|
911
|
+
}
|
912
|
+
FunctionType.isPartiallyEvaluated = isPartiallyEvaluated;
|
913
|
+
function getEffectiveParameterType(type, index) {
|
914
|
+
(0, debug_1.assert)(index < type.details.parameters.length, 'Parameter types array overflow');
|
915
|
+
if (type.specializedTypes && index < type.specializedTypes.parameterTypes.length) {
|
916
|
+
return type.specializedTypes.parameterTypes[index];
|
917
|
+
}
|
918
|
+
return type.details.parameters[index].type;
|
919
|
+
}
|
920
|
+
FunctionType.getEffectiveParameterType = getEffectiveParameterType;
|
921
|
+
function getEffectiveParameterDefaultArgType(type, index) {
|
922
|
+
var _a;
|
923
|
+
(0, debug_1.assert)(index < type.details.parameters.length, 'Parameter types array overflow');
|
924
|
+
if (((_a = type.specializedTypes) === null || _a === void 0 ? void 0 : _a.parameterDefaultArgs) && index < type.specializedTypes.parameterDefaultArgs.length) {
|
925
|
+
const defaultArgType = type.specializedTypes.parameterDefaultArgs[index];
|
926
|
+
if (defaultArgType) {
|
927
|
+
return defaultArgType;
|
928
|
+
}
|
929
|
+
}
|
930
|
+
return type.details.parameters[index].defaultType;
|
931
|
+
}
|
932
|
+
FunctionType.getEffectiveParameterDefaultArgType = getEffectiveParameterDefaultArgType;
|
933
|
+
function addParameter(type, param) {
|
934
|
+
type.details.parameters.push(param);
|
935
|
+
}
|
936
|
+
FunctionType.addParameter = addParameter;
|
937
|
+
function getSpecializedReturnType(type) {
|
938
|
+
return type.specializedTypes && type.specializedTypes.returnType
|
939
|
+
? type.specializedTypes.returnType
|
940
|
+
: type.details.declaredReturnType;
|
941
|
+
}
|
942
|
+
FunctionType.getSpecializedReturnType = getSpecializedReturnType;
|
943
|
+
})(FunctionType = exports.FunctionType || (exports.FunctionType = {}));
|
944
|
+
var OverloadedFunctionType;
|
945
|
+
(function (OverloadedFunctionType) {
|
946
|
+
function create(overloads) {
|
947
|
+
const newType = {
|
948
|
+
category: 6 /* OverloadedFunction */,
|
949
|
+
overloads,
|
950
|
+
flags: 2 /* Instance */,
|
951
|
+
};
|
952
|
+
return newType;
|
953
|
+
}
|
954
|
+
OverloadedFunctionType.create = create;
|
955
|
+
function addOverload(type, functionType) {
|
956
|
+
type.overloads.push(functionType);
|
957
|
+
}
|
958
|
+
OverloadedFunctionType.addOverload = addOverload;
|
959
|
+
})(OverloadedFunctionType = exports.OverloadedFunctionType || (exports.OverloadedFunctionType = {}));
|
960
|
+
var NoneType;
|
961
|
+
(function (NoneType) {
|
962
|
+
const _noneInstance = {
|
963
|
+
category: 3 /* None */,
|
964
|
+
flags: 2 /* Instance */,
|
965
|
+
};
|
966
|
+
const _noneType = {
|
967
|
+
category: 3 /* None */,
|
968
|
+
flags: 1 /* Instantiable */,
|
969
|
+
};
|
970
|
+
function createInstance() {
|
971
|
+
return _noneInstance;
|
972
|
+
}
|
973
|
+
NoneType.createInstance = createInstance;
|
974
|
+
function createType() {
|
975
|
+
return _noneType;
|
976
|
+
}
|
977
|
+
NoneType.createType = createType;
|
978
|
+
})(NoneType = exports.NoneType || (exports.NoneType = {}));
|
979
|
+
var NeverType;
|
980
|
+
(function (NeverType) {
|
981
|
+
const _neverInstance = {
|
982
|
+
category: 4 /* Never */,
|
983
|
+
flags: 2 /* Instance */ | 1 /* Instantiable */,
|
984
|
+
isNoReturn: false,
|
985
|
+
};
|
986
|
+
const _noReturnInstance = {
|
987
|
+
category: 4 /* Never */,
|
988
|
+
flags: 2 /* Instance */ | 1 /* Instantiable */,
|
989
|
+
isNoReturn: true,
|
990
|
+
};
|
991
|
+
function createNever() {
|
992
|
+
return _neverInstance;
|
993
|
+
}
|
994
|
+
NeverType.createNever = createNever;
|
995
|
+
function createNoReturn() {
|
996
|
+
return _noReturnInstance;
|
997
|
+
}
|
998
|
+
NeverType.createNoReturn = createNoReturn;
|
999
|
+
})(NeverType = exports.NeverType || (exports.NeverType = {}));
|
1000
|
+
var AnyType;
|
1001
|
+
(function (AnyType) {
|
1002
|
+
const _anyInstance = {
|
1003
|
+
category: 2 /* Any */,
|
1004
|
+
isEllipsis: false,
|
1005
|
+
flags: 2 /* Instance */ | 1 /* Instantiable */,
|
1006
|
+
};
|
1007
|
+
const _ellipsisInstance = {
|
1008
|
+
category: 2 /* Any */,
|
1009
|
+
isEllipsis: true,
|
1010
|
+
flags: 2 /* Instance */ | 1 /* Instantiable */,
|
1011
|
+
};
|
1012
|
+
function create(isEllipsis = false) {
|
1013
|
+
return isEllipsis ? _ellipsisInstance : _anyInstance;
|
1014
|
+
}
|
1015
|
+
AnyType.create = create;
|
1016
|
+
})(AnyType = exports.AnyType || (exports.AnyType = {}));
|
1017
|
+
var TypeCondition;
|
1018
|
+
(function (TypeCondition) {
|
1019
|
+
function combine(conditions1, conditions2) {
|
1020
|
+
if (!conditions1) {
|
1021
|
+
return conditions2;
|
1022
|
+
}
|
1023
|
+
if (!conditions2) {
|
1024
|
+
return conditions1;
|
1025
|
+
}
|
1026
|
+
// Deduplicate the lists.
|
1027
|
+
const combined = [...conditions1];
|
1028
|
+
conditions2.forEach((c1) => {
|
1029
|
+
if (!combined.some((c2) => _compare(c1, c2) === 0)) {
|
1030
|
+
combined.push(c1);
|
1031
|
+
}
|
1032
|
+
});
|
1033
|
+
// Always keep the conditions sorted for easier comparison.
|
1034
|
+
return combined.sort(_compare);
|
1035
|
+
}
|
1036
|
+
TypeCondition.combine = combine;
|
1037
|
+
function _compare(c1, c2) {
|
1038
|
+
if (c1.typeVarName < c2.typeVarName) {
|
1039
|
+
return -1;
|
1040
|
+
}
|
1041
|
+
else if (c1.typeVarName > c2.typeVarName) {
|
1042
|
+
return 1;
|
1043
|
+
}
|
1044
|
+
if (c1.constraintIndex < c2.constraintIndex) {
|
1045
|
+
return -1;
|
1046
|
+
}
|
1047
|
+
else if (c1.constraintIndex > c2.constraintIndex) {
|
1048
|
+
return 1;
|
1049
|
+
}
|
1050
|
+
return 0;
|
1051
|
+
}
|
1052
|
+
function isSame(conditions1, conditions2) {
|
1053
|
+
if (!conditions1) {
|
1054
|
+
return !conditions2;
|
1055
|
+
}
|
1056
|
+
if (!conditions2 || conditions1.length !== conditions2.length) {
|
1057
|
+
return false;
|
1058
|
+
}
|
1059
|
+
return (conditions1.find((c1, index) => c1.typeVarName !== conditions2[index].typeVarName ||
|
1060
|
+
c1.constraintIndex !== conditions2[index].constraintIndex) === undefined);
|
1061
|
+
}
|
1062
|
+
TypeCondition.isSame = isSame;
|
1063
|
+
// Determines if the two conditions can be used at the same time. If
|
1064
|
+
// one constraint list contains a constraint for a type variable, and the
|
1065
|
+
// same constraint is not in the other constraint list, the two are considered
|
1066
|
+
// incompatible.
|
1067
|
+
function isCompatible(conditions1, conditions2) {
|
1068
|
+
if (!conditions1 || !conditions2) {
|
1069
|
+
return true;
|
1070
|
+
}
|
1071
|
+
for (const c1 of conditions1) {
|
1072
|
+
let foundTypeVarMatch = false;
|
1073
|
+
const exactMatch = conditions2.find((c2) => {
|
1074
|
+
if (c1.typeVarName === c2.typeVarName) {
|
1075
|
+
foundTypeVarMatch = true;
|
1076
|
+
return c1.constraintIndex === c2.constraintIndex;
|
1077
|
+
}
|
1078
|
+
return false;
|
1079
|
+
});
|
1080
|
+
if (foundTypeVarMatch && !exactMatch) {
|
1081
|
+
return false;
|
1082
|
+
}
|
1083
|
+
}
|
1084
|
+
return true;
|
1085
|
+
}
|
1086
|
+
TypeCondition.isCompatible = isCompatible;
|
1087
|
+
})(TypeCondition = exports.TypeCondition || (exports.TypeCondition = {}));
|
1088
|
+
var UnionType;
|
1089
|
+
(function (UnionType) {
|
1090
|
+
function create() {
|
1091
|
+
const newUnionType = {
|
1092
|
+
category: 9 /* Union */,
|
1093
|
+
subtypes: [],
|
1094
|
+
flags: 2 /* Instance */ | 1 /* Instantiable */,
|
1095
|
+
};
|
1096
|
+
return newUnionType;
|
1097
|
+
}
|
1098
|
+
UnionType.create = create;
|
1099
|
+
function addType(unionType, newType) {
|
1100
|
+
// If we're adding a string literal or integer type, add it to the
|
1101
|
+
// corresponding literal map to speed up some operations. It's not
|
1102
|
+
// uncommon for unions to contain hundreds of literals.
|
1103
|
+
if (isClassInstance(newType) && newType.literalValue !== undefined && newType.condition === undefined) {
|
1104
|
+
if (ClassType.isBuiltIn(newType, 'str')) {
|
1105
|
+
if (unionType.literalStrMap === undefined) {
|
1106
|
+
unionType.literalStrMap = new Map();
|
1107
|
+
}
|
1108
|
+
unionType.literalStrMap.set(newType.literalValue, newType);
|
1109
|
+
}
|
1110
|
+
else if (ClassType.isBuiltIn(newType, 'int')) {
|
1111
|
+
if (unionType.literalIntMap === undefined) {
|
1112
|
+
unionType.literalIntMap = new Map();
|
1113
|
+
}
|
1114
|
+
unionType.literalIntMap.set(newType.literalValue, newType);
|
1115
|
+
}
|
1116
|
+
}
|
1117
|
+
unionType.flags &= newType.flags;
|
1118
|
+
unionType.subtypes.push(newType);
|
1119
|
+
}
|
1120
|
+
UnionType.addType = addType;
|
1121
|
+
function containsType(unionType, subtype, recursionCount = 0) {
|
1122
|
+
// Handle string literals as a special case because unions can sometimes
|
1123
|
+
// contain hundreds of string literal types.
|
1124
|
+
if (isClassInstance(subtype) && subtype.condition === undefined && subtype.literalValue !== undefined) {
|
1125
|
+
if (ClassType.isBuiltIn(subtype, 'str') && unionType.literalStrMap !== undefined) {
|
1126
|
+
return unionType.literalStrMap.has(subtype.literalValue);
|
1127
|
+
}
|
1128
|
+
else if (ClassType.isBuiltIn(subtype, 'int') && unionType.literalIntMap !== undefined) {
|
1129
|
+
return unionType.literalIntMap.has(subtype.literalValue);
|
1130
|
+
}
|
1131
|
+
}
|
1132
|
+
return (unionType.subtypes.find((t) => isTypeSame(t, subtype,
|
1133
|
+
/* ignorePseudoGeneric */ undefined,
|
1134
|
+
/* ignoreTypeFlags */ undefined, recursionCount)) !== undefined);
|
1135
|
+
}
|
1136
|
+
UnionType.containsType = containsType;
|
1137
|
+
function addTypeAliasSource(unionType, typeAliasSource) {
|
1138
|
+
if (typeAliasSource.category === 9 /* Union */) {
|
1139
|
+
const sourcesToAdd = typeAliasSource.typeAliasInfo ? [typeAliasSource] : typeAliasSource.typeAliasSources;
|
1140
|
+
if (sourcesToAdd) {
|
1141
|
+
if (!unionType.typeAliasSources) {
|
1142
|
+
unionType.typeAliasSources = new Set();
|
1143
|
+
}
|
1144
|
+
sourcesToAdd.forEach((source) => {
|
1145
|
+
unionType.typeAliasSources.add(source);
|
1146
|
+
});
|
1147
|
+
}
|
1148
|
+
}
|
1149
|
+
}
|
1150
|
+
UnionType.addTypeAliasSource = addTypeAliasSource;
|
1151
|
+
})(UnionType = exports.UnionType || (exports.UnionType = {}));
|
1152
|
+
var TypeVarType;
|
1153
|
+
(function (TypeVarType) {
|
1154
|
+
function createInstance(name) {
|
1155
|
+
return create(name, /* isParamSpec */ false, 2 /* Instance */);
|
1156
|
+
}
|
1157
|
+
TypeVarType.createInstance = createInstance;
|
1158
|
+
function createInstantiable(name, isParamSpec = false) {
|
1159
|
+
return create(name, isParamSpec, 1 /* Instantiable */);
|
1160
|
+
}
|
1161
|
+
TypeVarType.createInstantiable = createInstantiable;
|
1162
|
+
function cloneAsInstance(type) {
|
1163
|
+
(0, debug_1.assert)(TypeBase.isInstantiable(type));
|
1164
|
+
const newInstance = TypeBase.cloneTypeAsInstance(type);
|
1165
|
+
newInstance.flags &= ~8 /* SpecialForm */;
|
1166
|
+
return newInstance;
|
1167
|
+
}
|
1168
|
+
TypeVarType.cloneAsInstance = cloneAsInstance;
|
1169
|
+
function cloneAsInstantiable(type) {
|
1170
|
+
const newInstance = TypeBase.cloneTypeAsInstantiable(type);
|
1171
|
+
newInstance.flags &= ~8 /* SpecialForm */;
|
1172
|
+
return newInstance;
|
1173
|
+
}
|
1174
|
+
TypeVarType.cloneAsInstantiable = cloneAsInstantiable;
|
1175
|
+
function cloneForScopeId(type, scopeId, scopeName, scopeType) {
|
1176
|
+
const newInstance = TypeBase.cloneType(type);
|
1177
|
+
newInstance.nameWithScope = makeNameWithScope(type.details.name, scopeId);
|
1178
|
+
newInstance.scopeId = scopeId;
|
1179
|
+
newInstance.scopeName = scopeName;
|
1180
|
+
newInstance.scopeType = scopeType;
|
1181
|
+
return newInstance;
|
1182
|
+
}
|
1183
|
+
TypeVarType.cloneForScopeId = cloneForScopeId;
|
1184
|
+
function cloneForUnpacked(type, isInUnion = false) {
|
1185
|
+
(0, debug_1.assert)(type.details.isVariadic);
|
1186
|
+
const newInstance = TypeBase.cloneType(type);
|
1187
|
+
newInstance.isVariadicUnpacked = true;
|
1188
|
+
newInstance.isVariadicInUnion = isInUnion;
|
1189
|
+
return newInstance;
|
1190
|
+
}
|
1191
|
+
TypeVarType.cloneForUnpacked = cloneForUnpacked;
|
1192
|
+
function cloneForPacked(type) {
|
1193
|
+
(0, debug_1.assert)(type.details.isVariadic);
|
1194
|
+
const newInstance = TypeBase.cloneType(type);
|
1195
|
+
newInstance.isVariadicUnpacked = false;
|
1196
|
+
newInstance.isVariadicInUnion = false;
|
1197
|
+
return newInstance;
|
1198
|
+
}
|
1199
|
+
TypeVarType.cloneForPacked = cloneForPacked;
|
1200
|
+
// Creates a "simplified" version of the TypeVar with invariance
|
1201
|
+
// and no bound or constraints. ParamSpecs and variadics are left unmodified.
|
1202
|
+
function cloneAsInvariant(type) {
|
1203
|
+
if (type.details.isParamSpec || type.details.isVariadic) {
|
1204
|
+
return type;
|
1205
|
+
}
|
1206
|
+
if (type.details.variance === 0 /* Invariant */) {
|
1207
|
+
if (type.details.boundType === undefined && type.details.constraints.length === 0) {
|
1208
|
+
return type;
|
1209
|
+
}
|
1210
|
+
}
|
1211
|
+
const newInstance = TypeBase.cloneType(type);
|
1212
|
+
newInstance.details = { ...newInstance.details };
|
1213
|
+
newInstance.details.variance = 0 /* Invariant */;
|
1214
|
+
newInstance.details.boundType = undefined;
|
1215
|
+
newInstance.details.constraints = [];
|
1216
|
+
return newInstance;
|
1217
|
+
}
|
1218
|
+
TypeVarType.cloneAsInvariant = cloneAsInvariant;
|
1219
|
+
function cloneForParamSpecAccess(type, access) {
|
1220
|
+
const newInstance = TypeBase.cloneType(type);
|
1221
|
+
newInstance.paramSpecAccess = access;
|
1222
|
+
return newInstance;
|
1223
|
+
}
|
1224
|
+
TypeVarType.cloneForParamSpecAccess = cloneForParamSpecAccess;
|
1225
|
+
function cloneAsSpecializedSelf(type, specializedBoundType) {
|
1226
|
+
(0, debug_1.assert)(type.details.isSynthesizedSelf);
|
1227
|
+
const newInstance = TypeBase.cloneType(type);
|
1228
|
+
newInstance.details = { ...newInstance.details };
|
1229
|
+
newInstance.details.boundType = specializedBoundType;
|
1230
|
+
return newInstance;
|
1231
|
+
}
|
1232
|
+
TypeVarType.cloneAsSpecializedSelf = cloneAsSpecializedSelf;
|
1233
|
+
function makeNameWithScope(name, scopeId) {
|
1234
|
+
return `${name}.${scopeId}`;
|
1235
|
+
}
|
1236
|
+
TypeVarType.makeNameWithScope = makeNameWithScope;
|
1237
|
+
function create(name, isParamSpec, typeFlags) {
|
1238
|
+
const newTypeVarType = {
|
1239
|
+
category: 10 /* TypeVar */,
|
1240
|
+
details: {
|
1241
|
+
name,
|
1242
|
+
constraints: [],
|
1243
|
+
variance: 0 /* Invariant */,
|
1244
|
+
isParamSpec,
|
1245
|
+
isVariadic: false,
|
1246
|
+
isSynthesized: false,
|
1247
|
+
},
|
1248
|
+
flags: typeFlags,
|
1249
|
+
};
|
1250
|
+
return newTypeVarType;
|
1251
|
+
}
|
1252
|
+
function addConstraint(typeVarType, constraintType) {
|
1253
|
+
typeVarType.details.constraints.push(constraintType);
|
1254
|
+
}
|
1255
|
+
TypeVarType.addConstraint = addConstraint;
|
1256
|
+
function getNameWithScope(typeVarType) {
|
1257
|
+
// If there is no name with scope, fall back on the (unscoped) name.
|
1258
|
+
return typeVarType.nameWithScope || typeVarType.details.name;
|
1259
|
+
}
|
1260
|
+
TypeVarType.getNameWithScope = getNameWithScope;
|
1261
|
+
function getReadableName(typeVarType) {
|
1262
|
+
if (typeVarType.scopeName) {
|
1263
|
+
return `${typeVarType.details.name}@${typeVarType.scopeName}`;
|
1264
|
+
}
|
1265
|
+
return typeVarType.details.name;
|
1266
|
+
}
|
1267
|
+
TypeVarType.getReadableName = getReadableName;
|
1268
|
+
})(TypeVarType = exports.TypeVarType || (exports.TypeVarType = {}));
|
1269
|
+
function isNever(type) {
|
1270
|
+
return type.category === 4 /* Never */;
|
1271
|
+
}
|
1272
|
+
exports.isNever = isNever;
|
1273
|
+
function isNoneInstance(type) {
|
1274
|
+
return type.category === 3 /* None */ && TypeBase.isInstance(type);
|
1275
|
+
}
|
1276
|
+
exports.isNoneInstance = isNoneInstance;
|
1277
|
+
function isNoneTypeClass(type) {
|
1278
|
+
return type.category === 3 /* None */ && TypeBase.isInstantiable(type);
|
1279
|
+
}
|
1280
|
+
exports.isNoneTypeClass = isNoneTypeClass;
|
1281
|
+
function isAny(type) {
|
1282
|
+
return type.category === 2 /* Any */;
|
1283
|
+
}
|
1284
|
+
exports.isAny = isAny;
|
1285
|
+
function isUnknown(type) {
|
1286
|
+
return type.category === 1 /* Unknown */;
|
1287
|
+
}
|
1288
|
+
exports.isUnknown = isUnknown;
|
1289
|
+
function isAnyOrUnknown(type) {
|
1290
|
+
if (type.category === 2 /* Any */ || type.category === 1 /* Unknown */) {
|
1291
|
+
return true;
|
1292
|
+
}
|
1293
|
+
if (isUnion(type)) {
|
1294
|
+
return type.subtypes.find((subtype) => !isAnyOrUnknown(subtype)) === undefined;
|
1295
|
+
}
|
1296
|
+
return false;
|
1297
|
+
}
|
1298
|
+
exports.isAnyOrUnknown = isAnyOrUnknown;
|
1299
|
+
function isUnbound(type) {
|
1300
|
+
return type.category === 0 /* Unbound */;
|
1301
|
+
}
|
1302
|
+
exports.isUnbound = isUnbound;
|
1303
|
+
function isUnion(type) {
|
1304
|
+
return type.category === 9 /* Union */;
|
1305
|
+
}
|
1306
|
+
exports.isUnion = isUnion;
|
1307
|
+
function isPossiblyUnbound(type) {
|
1308
|
+
if (isUnbound(type)) {
|
1309
|
+
return true;
|
1310
|
+
}
|
1311
|
+
if (isUnion(type)) {
|
1312
|
+
return type.subtypes.find((subtype) => isPossiblyUnbound(subtype)) !== undefined;
|
1313
|
+
}
|
1314
|
+
return false;
|
1315
|
+
}
|
1316
|
+
exports.isPossiblyUnbound = isPossiblyUnbound;
|
1317
|
+
function isClass(type) {
|
1318
|
+
return type.category === 7 /* Class */;
|
1319
|
+
}
|
1320
|
+
exports.isClass = isClass;
|
1321
|
+
function isInstantiableClass(type) {
|
1322
|
+
return type.category === 7 /* Class */ && TypeBase.isInstantiable(type);
|
1323
|
+
}
|
1324
|
+
exports.isInstantiableClass = isInstantiableClass;
|
1325
|
+
function isClassInstance(type) {
|
1326
|
+
return type.category === 7 /* Class */ && TypeBase.isInstance(type);
|
1327
|
+
}
|
1328
|
+
exports.isClassInstance = isClassInstance;
|
1329
|
+
function isModule(type) {
|
1330
|
+
return type.category === 8 /* Module */;
|
1331
|
+
}
|
1332
|
+
exports.isModule = isModule;
|
1333
|
+
function isTypeVar(type) {
|
1334
|
+
return type.category === 10 /* TypeVar */;
|
1335
|
+
}
|
1336
|
+
exports.isTypeVar = isTypeVar;
|
1337
|
+
function isVariadicTypeVar(type) {
|
1338
|
+
return type.category === 10 /* TypeVar */ && type.details.isVariadic;
|
1339
|
+
}
|
1340
|
+
exports.isVariadicTypeVar = isVariadicTypeVar;
|
1341
|
+
function isUnpackedVariadicTypeVar(type) {
|
1342
|
+
if (isUnion(type) && type.subtypes.length === 1) {
|
1343
|
+
type = type.subtypes[0];
|
1344
|
+
}
|
1345
|
+
return type.category === 10 /* TypeVar */ && type.details.isVariadic && !!type.isVariadicUnpacked;
|
1346
|
+
}
|
1347
|
+
exports.isUnpackedVariadicTypeVar = isUnpackedVariadicTypeVar;
|
1348
|
+
function isUnpackedClass(type) {
|
1349
|
+
if (!isClass(type) || !type.isUnpacked) {
|
1350
|
+
return false;
|
1351
|
+
}
|
1352
|
+
return true;
|
1353
|
+
}
|
1354
|
+
exports.isUnpackedClass = isUnpackedClass;
|
1355
|
+
function isUnpacked(type) {
|
1356
|
+
return isUnpackedVariadicTypeVar(type) || isUnpackedClass(type);
|
1357
|
+
}
|
1358
|
+
exports.isUnpacked = isUnpacked;
|
1359
|
+
function isParamSpec(type) {
|
1360
|
+
return type.category === 10 /* TypeVar */ && type.details.isParamSpec;
|
1361
|
+
}
|
1362
|
+
exports.isParamSpec = isParamSpec;
|
1363
|
+
function isFunction(type) {
|
1364
|
+
return type.category === 5 /* Function */;
|
1365
|
+
}
|
1366
|
+
exports.isFunction = isFunction;
|
1367
|
+
function isOverloadedFunction(type) {
|
1368
|
+
return type.category === 6 /* OverloadedFunction */;
|
1369
|
+
}
|
1370
|
+
exports.isOverloadedFunction = isOverloadedFunction;
|
1371
|
+
function getTypeAliasInfo(type) {
|
1372
|
+
if (type.typeAliasInfo) {
|
1373
|
+
return type.typeAliasInfo;
|
1374
|
+
}
|
1375
|
+
if (isTypeVar(type) &&
|
1376
|
+
type.details.recursiveTypeAliasName &&
|
1377
|
+
type.details.boundType &&
|
1378
|
+
type.details.boundType.typeAliasInfo) {
|
1379
|
+
return type.details.boundType.typeAliasInfo;
|
1380
|
+
}
|
1381
|
+
return undefined;
|
1382
|
+
}
|
1383
|
+
exports.getTypeAliasInfo = getTypeAliasInfo;
|
1384
|
+
// Determines whether two types are the same. If ignorePseudoGeneric is true,
|
1385
|
+
// type arguments for "pseudo-generic" classes (non-generic classes whose init
|
1386
|
+
// methods are not annotated and are therefore treated as generic) are ignored.
|
1387
|
+
function isTypeSame(type1, type2, ignorePseudoGeneric = false, ignoreTypeFlags = false, recursionCount = 0) {
|
1388
|
+
var _a, _b;
|
1389
|
+
if (type1 === type2) {
|
1390
|
+
return true;
|
1391
|
+
}
|
1392
|
+
if (type1.category !== type2.category) {
|
1393
|
+
return false;
|
1394
|
+
}
|
1395
|
+
if (!ignoreTypeFlags && type1.flags !== type2.flags) {
|
1396
|
+
return false;
|
1397
|
+
}
|
1398
|
+
if (recursionCount > exports.maxTypeRecursionCount) {
|
1399
|
+
return true;
|
1400
|
+
}
|
1401
|
+
recursionCount++;
|
1402
|
+
switch (type1.category) {
|
1403
|
+
case 7 /* Class */: {
|
1404
|
+
const classType2 = type2;
|
1405
|
+
// If the details are not the same it's not the same class.
|
1406
|
+
if (!ClassType.isSameGenericClass(type1, classType2, recursionCount)) {
|
1407
|
+
return false;
|
1408
|
+
}
|
1409
|
+
if (!TypeCondition.isSame(type1.condition, type2.condition)) {
|
1410
|
+
return false;
|
1411
|
+
}
|
1412
|
+
if (!ignorePseudoGeneric || !ClassType.isPseudoGenericClass(type1)) {
|
1413
|
+
// Make sure the type args match.
|
1414
|
+
if (type1.tupleTypeArguments && classType2.tupleTypeArguments) {
|
1415
|
+
const type1TupleTypeArgs = type1.tupleTypeArguments || [];
|
1416
|
+
const type2TupleTypeArgs = classType2.tupleTypeArguments || [];
|
1417
|
+
if (type1TupleTypeArgs.length !== type2TupleTypeArgs.length) {
|
1418
|
+
return false;
|
1419
|
+
}
|
1420
|
+
for (let i = 0; i < type1TupleTypeArgs.length; i++) {
|
1421
|
+
if (!isTypeSame(type1TupleTypeArgs[i].type, type2TupleTypeArgs[i].type, ignorePseudoGeneric,
|
1422
|
+
/* ignoreTypeFlags */ false, recursionCount)) {
|
1423
|
+
return false;
|
1424
|
+
}
|
1425
|
+
if (type1TupleTypeArgs[i].isUnbounded !== type2TupleTypeArgs[i].isUnbounded) {
|
1426
|
+
return false;
|
1427
|
+
}
|
1428
|
+
}
|
1429
|
+
}
|
1430
|
+
else {
|
1431
|
+
const type1TypeArgs = type1.typeArguments || [];
|
1432
|
+
const type2TypeArgs = classType2.typeArguments || [];
|
1433
|
+
const typeArgCount = Math.max(type1TypeArgs.length, type2TypeArgs.length);
|
1434
|
+
for (let i = 0; i < typeArgCount; i++) {
|
1435
|
+
// Assume that missing type args are "Any".
|
1436
|
+
const typeArg1 = i < type1TypeArgs.length ? type1TypeArgs[i] : AnyType.create();
|
1437
|
+
const typeArg2 = i < type2TypeArgs.length ? type2TypeArgs[i] : AnyType.create();
|
1438
|
+
if (!isTypeSame(typeArg1, typeArg2, ignorePseudoGeneric,
|
1439
|
+
/* ignoreTypeFlags */ false, recursionCount)) {
|
1440
|
+
return false;
|
1441
|
+
}
|
1442
|
+
}
|
1443
|
+
}
|
1444
|
+
}
|
1445
|
+
if (!ClassType.isLiteralValueSame(type1, classType2)) {
|
1446
|
+
return false;
|
1447
|
+
}
|
1448
|
+
return true;
|
1449
|
+
}
|
1450
|
+
case 5 /* Function */: {
|
1451
|
+
// Make sure the parameter counts match.
|
1452
|
+
const functionType2 = type2;
|
1453
|
+
const params1 = type1.details.parameters;
|
1454
|
+
const params2 = functionType2.details.parameters;
|
1455
|
+
if (params1.length !== params2.length) {
|
1456
|
+
return false;
|
1457
|
+
}
|
1458
|
+
const positionalOnlyIndex1 = params1.findIndex((param) => param.category === 0 /* Simple */ && !param.name);
|
1459
|
+
const positionalOnlyIndex2 = params2.findIndex((param) => param.category === 0 /* Simple */ && !param.name);
|
1460
|
+
// Make sure the parameter details match.
|
1461
|
+
for (let i = 0; i < params1.length; i++) {
|
1462
|
+
const param1 = params1[i];
|
1463
|
+
const param2 = params2[i];
|
1464
|
+
if (param1.category !== param2.category) {
|
1465
|
+
return false;
|
1466
|
+
}
|
1467
|
+
const isName1Relevant = positionalOnlyIndex1 !== undefined && i >= positionalOnlyIndex1;
|
1468
|
+
const isName2Relevant = positionalOnlyIndex2 !== undefined && i >= positionalOnlyIndex2;
|
1469
|
+
if (isName1Relevant !== isName2Relevant) {
|
1470
|
+
return false;
|
1471
|
+
}
|
1472
|
+
if (isName1Relevant) {
|
1473
|
+
if (param1.name !== param2.name) {
|
1474
|
+
return false;
|
1475
|
+
}
|
1476
|
+
}
|
1477
|
+
const param1Type = FunctionType.getEffectiveParameterType(type1, i);
|
1478
|
+
const param2Type = FunctionType.getEffectiveParameterType(functionType2, i);
|
1479
|
+
if (!isTypeSame(param1Type, param2Type, ignorePseudoGeneric,
|
1480
|
+
/* ignoreTypeFlags */ false, recursionCount)) {
|
1481
|
+
return false;
|
1482
|
+
}
|
1483
|
+
}
|
1484
|
+
// Make sure the return types match.
|
1485
|
+
let return1Type = type1.details.declaredReturnType;
|
1486
|
+
if (type1.specializedTypes && type1.specializedTypes.returnType) {
|
1487
|
+
return1Type = type1.specializedTypes.returnType;
|
1488
|
+
}
|
1489
|
+
if (!return1Type && type1.inferredReturnType) {
|
1490
|
+
return1Type = type1.inferredReturnType;
|
1491
|
+
}
|
1492
|
+
let return2Type = functionType2.details.declaredReturnType;
|
1493
|
+
if (functionType2.specializedTypes && functionType2.specializedTypes.returnType) {
|
1494
|
+
return2Type = functionType2.specializedTypes.returnType;
|
1495
|
+
}
|
1496
|
+
if (!return2Type && functionType2.inferredReturnType) {
|
1497
|
+
return2Type = functionType2.inferredReturnType;
|
1498
|
+
}
|
1499
|
+
if (return1Type || return2Type) {
|
1500
|
+
if (!return1Type ||
|
1501
|
+
!return2Type ||
|
1502
|
+
!isTypeSame(return1Type, return2Type, ignorePseudoGeneric,
|
1503
|
+
/* ignoreTypeFlags */ false, recursionCount)) {
|
1504
|
+
return false;
|
1505
|
+
}
|
1506
|
+
}
|
1507
|
+
return true;
|
1508
|
+
}
|
1509
|
+
case 6 /* OverloadedFunction */: {
|
1510
|
+
// Make sure the overload counts match.
|
1511
|
+
const functionType2 = type2;
|
1512
|
+
if (type1.overloads.length !== functionType2.overloads.length) {
|
1513
|
+
return false;
|
1514
|
+
}
|
1515
|
+
// We assume here that overloaded functions always appear
|
1516
|
+
// in the same order from one analysis pass to another.
|
1517
|
+
for (let i = 0; i < type1.overloads.length; i++) {
|
1518
|
+
if (!isTypeSame(type1.overloads[i], functionType2.overloads[i], ignorePseudoGeneric, ignoreTypeFlags, recursionCount)) {
|
1519
|
+
return false;
|
1520
|
+
}
|
1521
|
+
}
|
1522
|
+
return true;
|
1523
|
+
}
|
1524
|
+
case 9 /* Union */: {
|
1525
|
+
const unionType2 = type2;
|
1526
|
+
const subtypes1 = type1.subtypes;
|
1527
|
+
const subtypes2 = unionType2.subtypes;
|
1528
|
+
if (subtypes1.length !== subtypes2.length) {
|
1529
|
+
return false;
|
1530
|
+
}
|
1531
|
+
// The types do not have a particular order, so we need to
|
1532
|
+
// do the comparison in an order-independent manner.
|
1533
|
+
return (findSubtype(type1, (subtype) => !UnionType.containsType(unionType2, subtype, recursionCount)) ===
|
1534
|
+
undefined);
|
1535
|
+
}
|
1536
|
+
case 10 /* TypeVar */: {
|
1537
|
+
const type2TypeVar = type2;
|
1538
|
+
if (type1.scopeId !== type2TypeVar.scopeId) {
|
1539
|
+
return false;
|
1540
|
+
}
|
1541
|
+
// Handle the case where this is a generic recursive type alias. Make
|
1542
|
+
// sure that the type argument types match.
|
1543
|
+
if (type1.details.recursiveTypeParameters && type2TypeVar.details.recursiveTypeParameters) {
|
1544
|
+
const type1TypeArgs = ((_a = type1 === null || type1 === void 0 ? void 0 : type1.typeAliasInfo) === null || _a === void 0 ? void 0 : _a.typeArguments) || [];
|
1545
|
+
const type2TypeArgs = ((_b = type2 === null || type2 === void 0 ? void 0 : type2.typeAliasInfo) === null || _b === void 0 ? void 0 : _b.typeArguments) || [];
|
1546
|
+
const typeArgCount = Math.max(type1TypeArgs.length, type2TypeArgs.length);
|
1547
|
+
for (let i = 0; i < typeArgCount; i++) {
|
1548
|
+
// Assume that missing type args are "Any".
|
1549
|
+
const typeArg1 = i < type1TypeArgs.length ? type1TypeArgs[i] : AnyType.create();
|
1550
|
+
const typeArg2 = i < type2TypeArgs.length ? type2TypeArgs[i] : AnyType.create();
|
1551
|
+
if (!isTypeSame(typeArg1, typeArg2, ignorePseudoGeneric,
|
1552
|
+
/* ignoreTypeFlags */ false, recursionCount)) {
|
1553
|
+
return false;
|
1554
|
+
}
|
1555
|
+
}
|
1556
|
+
}
|
1557
|
+
if (type1.details === type2TypeVar.details) {
|
1558
|
+
return true;
|
1559
|
+
}
|
1560
|
+
if (type1.details.name !== type2TypeVar.details.name ||
|
1561
|
+
type1.details.isParamSpec !== type2TypeVar.details.isParamSpec ||
|
1562
|
+
type1.details.isVariadic !== type2TypeVar.details.isVariadic ||
|
1563
|
+
type1.details.isSynthesized !== type2TypeVar.details.isSynthesized ||
|
1564
|
+
type1.details.variance !== type2TypeVar.details.variance ||
|
1565
|
+
type1.scopeId !== type2TypeVar.scopeId) {
|
1566
|
+
return false;
|
1567
|
+
}
|
1568
|
+
const boundType1 = type1.details.boundType;
|
1569
|
+
const boundType2 = type2TypeVar.details.boundType;
|
1570
|
+
if (boundType1) {
|
1571
|
+
if (!boundType2 ||
|
1572
|
+
!isTypeSame(boundType1, boundType2, ignorePseudoGeneric,
|
1573
|
+
/* ignoreTypeFlags */ false, recursionCount)) {
|
1574
|
+
return false;
|
1575
|
+
}
|
1576
|
+
}
|
1577
|
+
else {
|
1578
|
+
if (boundType2) {
|
1579
|
+
return false;
|
1580
|
+
}
|
1581
|
+
}
|
1582
|
+
const constraints1 = type1.details.constraints;
|
1583
|
+
const constraints2 = type2TypeVar.details.constraints;
|
1584
|
+
if (constraints1.length !== constraints2.length) {
|
1585
|
+
return false;
|
1586
|
+
}
|
1587
|
+
for (let i = 0; i < constraints1.length; i++) {
|
1588
|
+
if (!isTypeSame(constraints1[i], constraints2[i], ignorePseudoGeneric,
|
1589
|
+
/* ignoreTypeFlags */ false, recursionCount)) {
|
1590
|
+
return false;
|
1591
|
+
}
|
1592
|
+
}
|
1593
|
+
return true;
|
1594
|
+
}
|
1595
|
+
case 8 /* Module */: {
|
1596
|
+
const type2Module = type2;
|
1597
|
+
// Module types are the same if they share the same
|
1598
|
+
// module symbol table.
|
1599
|
+
if (type1.fields === type2Module.fields) {
|
1600
|
+
return true;
|
1601
|
+
}
|
1602
|
+
// If both symbol tables are empty, we can also assume
|
1603
|
+
// they're equal.
|
1604
|
+
if (type1.fields.size === 0 && type2Module.fields.size === 0) {
|
1605
|
+
return true;
|
1606
|
+
}
|
1607
|
+
return false;
|
1608
|
+
}
|
1609
|
+
}
|
1610
|
+
return true;
|
1611
|
+
}
|
1612
|
+
exports.isTypeSame = isTypeSame;
|
1613
|
+
// If the type is a union, remove an "unknown" type from the union,
|
1614
|
+
// returning only the known types.
|
1615
|
+
function removeUnknownFromUnion(type) {
|
1616
|
+
return removeFromUnion(type, (t) => isUnknown(t));
|
1617
|
+
}
|
1618
|
+
exports.removeUnknownFromUnion = removeUnknownFromUnion;
|
1619
|
+
function removeIncompleteUnknownFromUnion(type) {
|
1620
|
+
return removeFromUnion(type, (t) => isUnknown(t) && t.isIncomplete);
|
1621
|
+
}
|
1622
|
+
exports.removeIncompleteUnknownFromUnion = removeIncompleteUnknownFromUnion;
|
1623
|
+
// If the type is a union, remove an "unbound" type from the union,
|
1624
|
+
// returning only the known types.
|
1625
|
+
function removeUnbound(type) {
|
1626
|
+
if (isUnion(type)) {
|
1627
|
+
return removeFromUnion(type, (t) => isUnbound(t));
|
1628
|
+
}
|
1629
|
+
if (isUnbound(type)) {
|
1630
|
+
return UnknownType.create();
|
1631
|
+
}
|
1632
|
+
return type;
|
1633
|
+
}
|
1634
|
+
exports.removeUnbound = removeUnbound;
|
1635
|
+
// If the type is a union, remove an "None" type from the union,
|
1636
|
+
// returning only the known types.
|
1637
|
+
function removeNoneFromUnion(type) {
|
1638
|
+
return removeFromUnion(type, (t) => isNoneInstance(t));
|
1639
|
+
}
|
1640
|
+
exports.removeNoneFromUnion = removeNoneFromUnion;
|
1641
|
+
function removeFromUnion(type, removeFilter) {
|
1642
|
+
if (isUnion(type)) {
|
1643
|
+
const remainingTypes = type.subtypes.filter((t) => !removeFilter(t));
|
1644
|
+
if (remainingTypes.length < type.subtypes.length) {
|
1645
|
+
const newType = combineTypes(remainingTypes);
|
1646
|
+
if (isUnion(newType)) {
|
1647
|
+
UnionType.addTypeAliasSource(newType, type);
|
1648
|
+
}
|
1649
|
+
return newType;
|
1650
|
+
}
|
1651
|
+
}
|
1652
|
+
return type;
|
1653
|
+
}
|
1654
|
+
exports.removeFromUnion = removeFromUnion;
|
1655
|
+
function findSubtype(type, filter) {
|
1656
|
+
if (isUnion(type)) {
|
1657
|
+
return type.subtypes.find((subtype) => {
|
1658
|
+
return filter(subtype);
|
1659
|
+
});
|
1660
|
+
}
|
1661
|
+
return filter(type) ? type : undefined;
|
1662
|
+
}
|
1663
|
+
exports.findSubtype = findSubtype;
|
1664
|
+
// Combines multiple types into a single type. If the types are
|
1665
|
+
// the same, only one is returned. If they differ, they
|
1666
|
+
// are combined into a UnionType. NeverTypes are filtered out.
|
1667
|
+
// If no types remain in the end, a NeverType is returned.
|
1668
|
+
function combineTypes(subtypes, maxSubtypeCount) {
|
1669
|
+
// Filter out any "Never" and "NoReturn" types.
|
1670
|
+
let sawNoReturn = false;
|
1671
|
+
if (subtypes.some((subtype) => subtype.category === 4 /* Never */))
|
1672
|
+
subtypes = subtypes.filter((subtype) => {
|
1673
|
+
if (subtype.category === 4 /* Never */ && subtype.isNoReturn) {
|
1674
|
+
sawNoReturn = true;
|
1675
|
+
}
|
1676
|
+
return subtype.category !== 4 /* Never */;
|
1677
|
+
});
|
1678
|
+
if (subtypes.length === 0) {
|
1679
|
+
return sawNoReturn ? NeverType.createNoReturn() : NeverType.createNever();
|
1680
|
+
}
|
1681
|
+
// Handle the common case where there is only one type.
|
1682
|
+
// Also handle the common case where there are multiple copies of the same type.
|
1683
|
+
let allSubtypesAreSame = true;
|
1684
|
+
if (subtypes.length > 1) {
|
1685
|
+
for (let index = 1; index < subtypes.length; index++) {
|
1686
|
+
if (subtypes[index] !== subtypes[0]) {
|
1687
|
+
allSubtypesAreSame = false;
|
1688
|
+
break;
|
1689
|
+
}
|
1690
|
+
}
|
1691
|
+
}
|
1692
|
+
if (allSubtypesAreSame) {
|
1693
|
+
return subtypes[0];
|
1694
|
+
}
|
1695
|
+
// Expand all union types.
|
1696
|
+
let expandedTypes = [];
|
1697
|
+
const typeAliasSources = new Set();
|
1698
|
+
for (const subtype of subtypes) {
|
1699
|
+
if (isUnion(subtype)) {
|
1700
|
+
expandedTypes = expandedTypes.concat(subtype.subtypes);
|
1701
|
+
if (subtype.typeAliasInfo) {
|
1702
|
+
typeAliasSources.add(subtype);
|
1703
|
+
}
|
1704
|
+
else if (subtype.typeAliasSources) {
|
1705
|
+
subtype.typeAliasSources.forEach((subtype) => {
|
1706
|
+
typeAliasSources.add(subtype);
|
1707
|
+
});
|
1708
|
+
}
|
1709
|
+
}
|
1710
|
+
else {
|
1711
|
+
expandedTypes.push(subtype);
|
1712
|
+
}
|
1713
|
+
}
|
1714
|
+
// Sort all of the literal and empty types to the end.
|
1715
|
+
expandedTypes = expandedTypes.sort((type1, type2) => {
|
1716
|
+
if ((isClassInstance(type1) && type1.literalValue !== undefined) ||
|
1717
|
+
(isInstantiableClass(type1) && type1.literalValue !== undefined)) {
|
1718
|
+
return 1;
|
1719
|
+
}
|
1720
|
+
else if ((isClassInstance(type2) && type2.literalValue !== undefined) ||
|
1721
|
+
(isInstantiableClass(type2) && type2.literalValue !== undefined)) {
|
1722
|
+
return -1;
|
1723
|
+
}
|
1724
|
+
if (isClassInstance(type1) && type1.isEmptyContainer) {
|
1725
|
+
return 1;
|
1726
|
+
}
|
1727
|
+
else if (isClassInstance(type2) && type2.isEmptyContainer) {
|
1728
|
+
return -1;
|
1729
|
+
}
|
1730
|
+
return 0;
|
1731
|
+
});
|
1732
|
+
// If removing all NoReturn types results in no remaining types,
|
1733
|
+
// convert it to an unknown.
|
1734
|
+
if (expandedTypes.length === 0) {
|
1735
|
+
return UnknownType.create();
|
1736
|
+
}
|
1737
|
+
const newUnionType = UnionType.create();
|
1738
|
+
if (typeAliasSources.size > 0) {
|
1739
|
+
newUnionType.typeAliasSources = typeAliasSources;
|
1740
|
+
}
|
1741
|
+
let hitMaxSubtypeCount = false;
|
1742
|
+
expandedTypes.forEach((subtype, index) => {
|
1743
|
+
if (index === 0) {
|
1744
|
+
UnionType.addType(newUnionType, subtype);
|
1745
|
+
}
|
1746
|
+
else {
|
1747
|
+
if (maxSubtypeCount === undefined || newUnionType.subtypes.length < maxSubtypeCount) {
|
1748
|
+
_addTypeIfUnique(newUnionType, subtype);
|
1749
|
+
}
|
1750
|
+
else {
|
1751
|
+
hitMaxSubtypeCount = true;
|
1752
|
+
}
|
1753
|
+
}
|
1754
|
+
});
|
1755
|
+
if (hitMaxSubtypeCount) {
|
1756
|
+
return AnyType.create();
|
1757
|
+
}
|
1758
|
+
// If only one type remains, convert it from a union to a simple type.
|
1759
|
+
if (newUnionType.subtypes.length === 1) {
|
1760
|
+
return newUnionType.subtypes[0];
|
1761
|
+
}
|
1762
|
+
return newUnionType;
|
1763
|
+
}
|
1764
|
+
exports.combineTypes = combineTypes;
|
1765
|
+
// Determines whether the dest type is the same as the source type with
|
1766
|
+
// the possible exception that the source type has a literal value when
|
1767
|
+
// the dest does not.
|
1768
|
+
function isSameWithoutLiteralValue(destType, srcType) {
|
1769
|
+
// If it's the same with literals, great.
|
1770
|
+
if (isTypeSame(destType, srcType)) {
|
1771
|
+
return true;
|
1772
|
+
}
|
1773
|
+
if (isInstantiableClass(srcType) && srcType.literalValue !== undefined) {
|
1774
|
+
// Strip the literal.
|
1775
|
+
srcType = ClassType.cloneWithLiteral(srcType, /* value */ undefined);
|
1776
|
+
return isTypeSame(destType, srcType);
|
1777
|
+
}
|
1778
|
+
if (isClassInstance(srcType) && srcType.literalValue !== undefined) {
|
1779
|
+
// Strip the literal.
|
1780
|
+
srcType = ClassType.cloneWithLiteral(srcType, /* value */ undefined);
|
1781
|
+
return isTypeSame(destType, srcType);
|
1782
|
+
}
|
1783
|
+
return false;
|
1784
|
+
}
|
1785
|
+
exports.isSameWithoutLiteralValue = isSameWithoutLiteralValue;
|
1786
|
+
function _addTypeIfUnique(unionType, typeToAdd) {
|
1787
|
+
// Handle the addition of a string literal in a special manner to
|
1788
|
+
// avoid n^2 behavior in unions that contain hundreds of string
|
1789
|
+
// literal types. Skip this for constrained types.
|
1790
|
+
if (isClassInstance(typeToAdd) && typeToAdd.condition === undefined) {
|
1791
|
+
if (ClassType.isBuiltIn(typeToAdd, 'str') &&
|
1792
|
+
typeToAdd.literalValue !== undefined &&
|
1793
|
+
unionType.literalStrMap !== undefined) {
|
1794
|
+
if (!unionType.literalStrMap.has(typeToAdd.literalValue)) {
|
1795
|
+
UnionType.addType(unionType, typeToAdd);
|
1796
|
+
}
|
1797
|
+
return;
|
1798
|
+
}
|
1799
|
+
else if (ClassType.isBuiltIn(typeToAdd, 'int') &&
|
1800
|
+
typeToAdd.literalValue !== undefined &&
|
1801
|
+
unionType.literalIntMap !== undefined) {
|
1802
|
+
if (!unionType.literalIntMap.has(typeToAdd.literalValue)) {
|
1803
|
+
UnionType.addType(unionType, typeToAdd);
|
1804
|
+
}
|
1805
|
+
return;
|
1806
|
+
}
|
1807
|
+
}
|
1808
|
+
for (let i = 0; i < unionType.subtypes.length; i++) {
|
1809
|
+
const type = unionType.subtypes[i];
|
1810
|
+
// Does this type already exist in the types array?
|
1811
|
+
if (isTypeSame(type, typeToAdd)) {
|
1812
|
+
return;
|
1813
|
+
}
|
1814
|
+
// If the typeToAdd is a literal value and there's already
|
1815
|
+
// a non-literal type that matches, don't add the literal value.
|
1816
|
+
if (isClassInstance(type) && isClassInstance(typeToAdd)) {
|
1817
|
+
if (isSameWithoutLiteralValue(type, typeToAdd)) {
|
1818
|
+
if (type.literalValue === undefined) {
|
1819
|
+
return;
|
1820
|
+
}
|
1821
|
+
}
|
1822
|
+
// If we're adding Literal[False] or Literal[True] to its
|
1823
|
+
// opposite, combine them into a non-literal 'bool' type.
|
1824
|
+
if (ClassType.isBuiltIn(type, 'bool') &&
|
1825
|
+
!type.condition &&
|
1826
|
+
ClassType.isBuiltIn(typeToAdd, 'bool') &&
|
1827
|
+
!typeToAdd.condition) {
|
1828
|
+
if (typeToAdd.literalValue !== undefined && !typeToAdd.literalValue === type.literalValue) {
|
1829
|
+
unionType.subtypes[i] = ClassType.cloneWithLiteral(type, /* value */ undefined);
|
1830
|
+
return;
|
1831
|
+
}
|
1832
|
+
}
|
1833
|
+
}
|
1834
|
+
// If the typeToAdd is an empty container and there's already
|
1835
|
+
// non-empty container of the same type, don't add the empty container.
|
1836
|
+
if (isClassInstance(typeToAdd) && typeToAdd.isEmptyContainer) {
|
1837
|
+
if (isClassInstance(type) && ClassType.isSameGenericClass(type, typeToAdd)) {
|
1838
|
+
return;
|
1839
|
+
}
|
1840
|
+
}
|
1841
|
+
}
|
1842
|
+
UnionType.addType(unionType, typeToAdd);
|
1843
|
+
}
|
1844
|
+
//# sourceMappingURL=types.js.map
|