@zzzen/pyright-internal 1.2.0-dev.20240804 → 1.2.0-dev.20240818
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/analysis.js +2 -2
- package/dist/analyzer/analysis.js.map +1 -1
- package/dist/analyzer/analyzerFileInfo.js +2 -3
- package/dist/analyzer/analyzerFileInfo.js.map +1 -1
- package/dist/analyzer/analyzerNodeInfo.js +20 -21
- package/dist/analyzer/analyzerNodeInfo.js.map +1 -1
- package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -1
- package/dist/analyzer/binder.js +1 -1
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/cacheManager.d.ts +0 -1
- package/dist/analyzer/cacheManager.js.map +1 -1
- package/dist/analyzer/checker.d.ts +2 -0
- package/dist/analyzer/checker.js +272 -207
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/circularDependency.js.map +1 -1
- package/dist/analyzer/codeFlowEngine.js +6 -6
- package/dist/analyzer/codeFlowEngine.js.map +1 -1
- package/dist/analyzer/codeFlowTypes.d.ts +17 -17
- package/dist/analyzer/codeFlowTypes.js +5 -5
- package/dist/analyzer/codeFlowTypes.js.map +1 -1
- package/dist/analyzer/codeFlowUtils.js +1 -2
- package/dist/analyzer/codeFlowUtils.js.map +1 -1
- package/dist/analyzer/commentUtils.js +1 -2
- package/dist/analyzer/commentUtils.js.map +1 -1
- package/dist/analyzer/constraintSolution.d.ts +2 -1
- package/dist/analyzer/constraintSolution.js +7 -1
- package/dist/analyzer/constraintSolution.js.map +1 -1
- package/dist/analyzer/constraintSolver.d.ts +1 -2
- package/dist/analyzer/constraintSolver.js +139 -163
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/constraintTracker.d.ts +5 -4
- package/dist/analyzer/constraintTracker.js +14 -9
- package/dist/analyzer/constraintTracker.js.map +1 -1
- package/dist/analyzer/constructorTransform.js +8 -8
- package/dist/analyzer/constructorTransform.js.map +1 -1
- package/dist/analyzer/constructors.js +15 -16
- package/dist/analyzer/constructors.js.map +1 -1
- package/dist/analyzer/dataClasses.js +38 -27
- package/dist/analyzer/dataClasses.js.map +1 -1
- package/dist/analyzer/declaration.js +11 -11
- package/dist/analyzer/declaration.js.map +1 -1
- package/dist/analyzer/declarationUtils.js +8 -9
- package/dist/analyzer/declarationUtils.js.map +1 -1
- package/dist/analyzer/decorators.d.ts +1 -1
- package/dist/analyzer/decorators.js +33 -29
- package/dist/analyzer/decorators.js.map +1 -1
- package/dist/analyzer/docStringConversion.js +2 -3
- package/dist/analyzer/docStringConversion.js.map +1 -1
- package/dist/analyzer/docStringUtils.js +2 -3
- package/dist/analyzer/docStringUtils.js.map +1 -1
- package/dist/analyzer/enums.js +18 -15
- package/dist/analyzer/enums.js.map +1 -1
- package/dist/analyzer/functionTransform.d.ts +2 -2
- package/dist/analyzer/functionTransform.js +1 -2
- package/dist/analyzer/functionTransform.js.map +1 -1
- package/dist/analyzer/importResolver.d.ts +0 -1
- package/dist/analyzer/importResolver.js +8 -8
- package/dist/analyzer/importResolver.js.map +1 -1
- package/dist/analyzer/importStatementUtils.js +15 -15
- package/dist/analyzer/importStatementUtils.js.map +1 -1
- package/dist/analyzer/namedTuples.js +2 -3
- package/dist/analyzer/namedTuples.js.map +1 -1
- package/dist/analyzer/operations.js +142 -124
- package/dist/analyzer/operations.js.map +1 -1
- package/dist/analyzer/packageTypeReport.d.ts +3 -3
- package/dist/analyzer/packageTypeReport.js +2 -2
- package/dist/analyzer/packageTypeReport.js.map +1 -1
- package/dist/analyzer/packageTypeVerifier.js +9 -9
- package/dist/analyzer/packageTypeVerifier.js.map +1 -1
- package/dist/analyzer/parameterUtils.js +5 -5
- package/dist/analyzer/parameterUtils.js.map +1 -1
- package/dist/analyzer/parentDirectoryCache.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.js +94 -92
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/parseTreeWalker.js +2 -2
- package/dist/analyzer/parseTreeWalker.js.map +1 -1
- package/dist/analyzer/patternMatching.js +18 -22
- package/dist/analyzer/patternMatching.js.map +1 -1
- package/dist/analyzer/program.js +5 -1
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/properties.js +7 -9
- package/dist/analyzer/properties.js.map +1 -1
- package/dist/analyzer/protocols.d.ts +2 -2
- package/dist/analyzer/protocols.js +55 -50
- package/dist/analyzer/protocols.js.map +1 -1
- package/dist/analyzer/pyTypedUtils.js +2 -3
- package/dist/analyzer/pyTypedUtils.js.map +1 -1
- package/dist/analyzer/pythonPathUtils.js +8 -7
- package/dist/analyzer/pythonPathUtils.js.map +1 -1
- package/dist/analyzer/scope.js.map +1 -1
- package/dist/analyzer/scopeUtils.js +5 -6
- package/dist/analyzer/scopeUtils.js.map +1 -1
- package/dist/analyzer/service.d.ts +3 -0
- package/dist/analyzer/service.js +173 -103
- package/dist/analyzer/service.js.map +1 -1
- package/dist/analyzer/serviceUtils.js +5 -5
- package/dist/analyzer/serviceUtils.js.map +1 -1
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/sourceFileInfo.js.map +1 -1
- package/dist/analyzer/sourceFileInfoUtils.js +4 -5
- package/dist/analyzer/sourceFileInfoUtils.js.map +1 -1
- package/dist/analyzer/sourceMapper.js +5 -4
- package/dist/analyzer/sourceMapper.js.map +1 -1
- package/dist/analyzer/sourceMapperUtils.js +1 -2
- package/dist/analyzer/sourceMapperUtils.js.map +1 -1
- package/dist/analyzer/staticExpressions.js +11 -12
- package/dist/analyzer/staticExpressions.js.map +1 -1
- package/dist/analyzer/symbol.js.map +1 -1
- package/dist/analyzer/symbolNameUtils.js +8 -9
- package/dist/analyzer/symbolNameUtils.js.map +1 -1
- package/dist/analyzer/symbolUtils.js +4 -5
- package/dist/analyzer/symbolUtils.js.map +1 -1
- package/dist/analyzer/testWalker.js.map +1 -1
- package/dist/analyzer/tracePrinter.js +5 -4
- package/dist/analyzer/tracePrinter.js.map +1 -1
- package/dist/analyzer/tuples.d.ts +1 -1
- package/dist/analyzer/tuples.js +9 -10
- package/dist/analyzer/tuples.js.map +1 -1
- package/dist/analyzer/typeCacheUtils.js.map +1 -1
- package/dist/analyzer/typeComplexity.js +2 -3
- package/dist/analyzer/typeComplexity.js.map +1 -1
- package/dist/analyzer/typeDocStringUtils.d.ts +2 -2
- package/dist/analyzer/typeDocStringUtils.js +34 -25
- package/dist/analyzer/typeDocStringUtils.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +487 -483
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +8 -10
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
- package/dist/analyzer/typeEvaluatorWithTracker.js +1 -2
- package/dist/analyzer/typeEvaluatorWithTracker.js.map +1 -1
- package/dist/analyzer/typeGuards.js +31 -30
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typePrinter.js +11 -11
- package/dist/analyzer/typePrinter.js.map +1 -1
- package/dist/analyzer/typeStubWriter.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +12 -15
- package/dist/analyzer/typeUtils.js +181 -219
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typeWalker.d.ts +2 -2
- package/dist/analyzer/typeWalker.js +9 -4
- package/dist/analyzer/typeWalker.js.map +1 -1
- package/dist/analyzer/typedDicts.js +41 -41
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +18 -16
- package/dist/analyzer/types.js +74 -74
- package/dist/analyzer/types.js.map +1 -1
- package/dist/backgroundAnalysisBase.d.ts +0 -1
- package/dist/backgroundAnalysisBase.js.map +1 -1
- package/dist/backgroundThreadBase.d.ts +0 -1
- package/dist/backgroundThreadBase.js +7 -14
- package/dist/backgroundThreadBase.js.map +1 -1
- package/dist/commands/commandController.js.map +1 -1
- package/dist/commands/createTypeStub.js.map +1 -1
- package/dist/commands/dumpFileDebugInfoCommand.js +2 -2
- package/dist/commands/dumpFileDebugInfoCommand.js.map +1 -1
- package/dist/commands/quickActionCommand.js.map +1 -1
- package/dist/common/cancellationUtils.js +9 -9
- package/dist/common/cancellationUtils.js.map +1 -1
- package/dist/common/chokidarFileWatcherProvider.js +3 -3
- package/dist/common/chokidarFileWatcherProvider.js.map +1 -1
- package/dist/common/collectionUtils.js +23 -23
- package/dist/common/collectionUtils.js.map +1 -1
- package/dist/common/commandLineOptions.d.ts +19 -12
- package/dist/common/commandLineOptions.js +26 -9
- package/dist/common/commandLineOptions.js.map +1 -1
- package/dist/common/commandUtils.js +1 -2
- package/dist/common/commandUtils.js.map +1 -1
- package/dist/common/configOptions.d.ts +2 -2
- package/dist/common/configOptions.js +30 -40
- package/dist/common/configOptions.js.map +1 -1
- package/dist/common/console.js +4 -4
- package/dist/common/console.js.map +1 -1
- package/dist/common/core.js +21 -21
- package/dist/common/core.js.map +1 -1
- package/dist/common/crypto.js +1 -2
- package/dist/common/crypto.js.map +1 -1
- package/dist/common/debug.js +9 -10
- package/dist/common/debug.js.map +1 -1
- package/dist/common/deferred.js +3 -4
- package/dist/common/deferred.js.map +1 -1
- package/dist/common/diagnostic.js +3 -3
- package/dist/common/diagnostic.js.map +1 -1
- package/dist/common/diagnosticSink.js.map +1 -1
- package/dist/common/envVarUtils.js +2 -3
- package/dist/common/envVarUtils.js.map +1 -1
- package/dist/common/fileBasedCancellationUtils.js +4 -4
- package/dist/common/fileBasedCancellationUtils.js.map +1 -1
- package/dist/common/fileSystem.d.ts +0 -2
- package/dist/common/fileWatcher.js +2 -2
- package/dist/common/fileWatcher.js.map +1 -1
- package/dist/common/fullAccessHost.js +1 -1
- package/dist/common/fullAccessHost.js.map +1 -1
- package/dist/common/logTracker.js +2 -2
- package/dist/common/logTracker.js.map +1 -1
- package/dist/common/lspUtils.d.ts +1 -1
- package/dist/common/lspUtils.js +3 -4
- package/dist/common/lspUtils.js.map +1 -1
- package/dist/common/memUtils.js +2 -2
- package/dist/common/memUtils.js.map +1 -1
- package/dist/common/pathUtils.js +32 -32
- package/dist/common/pathUtils.js.map +1 -1
- package/dist/common/positionUtils.js +7 -8
- package/dist/common/positionUtils.js.map +1 -1
- package/dist/common/progressReporter.js.map +1 -1
- package/dist/common/pythonVersion.d.ts +17 -20
- package/dist/common/pythonVersion.js +81 -85
- package/dist/common/pythonVersion.js.map +1 -1
- package/dist/common/realFileSystem.d.ts +0 -2
- package/dist/common/realFileSystem.js +2 -2
- package/dist/common/realFileSystem.js.map +1 -1
- package/dist/common/serviceProvider.js.map +1 -1
- package/dist/common/serviceProviderExtensions.js +1 -2
- package/dist/common/serviceProviderExtensions.js.map +1 -1
- package/dist/common/stringUtils.js +12 -13
- package/dist/common/stringUtils.js.map +1 -1
- package/dist/common/textEditTracker.js.map +1 -1
- package/dist/common/textRange.js +13 -13
- package/dist/common/textRange.js.map +1 -1
- package/dist/common/textRangeCollection.js +2 -2
- package/dist/common/textRangeCollection.js.map +1 -1
- package/dist/common/timing.js.map +1 -1
- package/dist/common/uri/baseUri.js.map +1 -1
- package/dist/common/uri/fileUri.js.map +1 -1
- package/dist/common/uri/memoization.js +3 -4
- package/dist/common/uri/memoization.js.map +1 -1
- package/dist/common/uri/uri.js.map +1 -1
- package/dist/common/uri/uriUtils.d.ts +0 -1
- package/dist/common/uri/uriUtils.js +20 -20
- package/dist/common/uri/uriUtils.js.map +1 -1
- package/dist/common/uri/webUri.js.map +1 -1
- package/dist/common/workspaceEditUtils.js +8 -9
- package/dist/common/workspaceEditUtils.js.map +1 -1
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/analyzerServiceExecutor.js +30 -29
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
- package/dist/languageService/autoImporter.js +4 -4
- package/dist/languageService/autoImporter.js.map +1 -1
- package/dist/languageService/callHierarchyProvider.js.map +1 -1
- package/dist/languageService/codeActionProvider.js.map +1 -1
- package/dist/languageService/completionProvider.js +4 -4
- package/dist/languageService/completionProvider.js.map +1 -1
- package/dist/languageService/completionProviderUtils.js +4 -5
- package/dist/languageService/completionProviderUtils.js.map +1 -1
- package/dist/languageService/definitionProvider.js +5 -5
- package/dist/languageService/definitionProvider.js.map +1 -1
- package/dist/languageService/documentHighlightProvider.js.map +1 -1
- package/dist/languageService/documentSymbolCollector.js +3 -3
- package/dist/languageService/documentSymbolCollector.js.map +1 -1
- package/dist/languageService/documentSymbolProvider.js +2 -2
- package/dist/languageService/documentSymbolProvider.js.map +1 -1
- package/dist/languageService/dynamicFeature.js.map +1 -1
- package/dist/languageService/fileWatcherDynamicFeature.js.map +1 -1
- package/dist/languageService/hoverProvider.js +6 -6
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/importSorter.js.map +1 -1
- package/dist/languageService/navigationUtils.js +3 -4
- package/dist/languageService/navigationUtils.js.map +1 -1
- package/dist/languageService/quickActions.js +1 -2
- package/dist/languageService/quickActions.js.map +1 -1
- package/dist/languageService/referencesProvider.js.map +1 -1
- package/dist/languageService/renameProvider.js.map +1 -1
- package/dist/languageService/signatureHelpProvider.js.map +1 -1
- package/dist/languageService/symbolIndexer.js.map +1 -1
- package/dist/languageService/tooltipUtils.d.ts +5 -5
- package/dist/languageService/tooltipUtils.js +31 -31
- package/dist/languageService/tooltipUtils.js.map +1 -1
- package/dist/languageService/workspaceSymbolProvider.js.map +1 -1
- package/dist/localization/localize.d.ts +7 -4
- package/dist/localization/localize.js +9 -8
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.cs.json +0 -2
- package/dist/localization/package.nls.de.json +0 -2
- package/dist/localization/package.nls.en-us.json +4 -3
- package/dist/localization/package.nls.es.json +0 -2
- package/dist/localization/package.nls.fr.json +0 -2
- package/dist/localization/package.nls.it.json +0 -2
- package/dist/localization/package.nls.ja.json +0 -2
- package/dist/localization/package.nls.ko.json +0 -2
- package/dist/localization/package.nls.pl.json +0 -2
- package/dist/localization/package.nls.pt-br.json +0 -2
- package/dist/localization/package.nls.qps-ploc.json +0 -2
- package/dist/localization/package.nls.ru.json +0 -2
- package/dist/localization/package.nls.tr.json +0 -2
- package/dist/localization/package.nls.zh-cn.json +0 -2
- package/dist/localization/package.nls.zh-tw.json +0 -2
- package/dist/nodeMain.js +1 -2
- package/dist/nodeMain.js.map +1 -1
- package/dist/nodeServer.js +2 -3
- package/dist/nodeServer.js.map +1 -1
- package/dist/parser/characterStream.js.map +1 -1
- package/dist/parser/characters.js +10 -11
- package/dist/parser/characters.js.map +1 -1
- package/dist/parser/parseNodes.d.ts +8 -8
- package/dist/parser/parseNodes.js +5 -5
- package/dist/parser/parseNodes.js.map +1 -1
- package/dist/parser/parser.js +32 -23
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/stringTokenUtils.js +2 -2
- package/dist/parser/stringTokenUtils.js.map +1 -1
- package/dist/parser/tokenizer.js.map +1 -1
- package/dist/parser/unicode.js +468 -468
- package/dist/parser/unicode.js.map +1 -1
- package/dist/pprof/profiler.js +2 -3
- package/dist/pprof/profiler.js.map +1 -1
- package/dist/pyright.js +22 -23
- package/dist/pyright.js.map +1 -1
- package/dist/pyrightFileSystem.d.ts +0 -2
- package/dist/pyrightFileSystem.js.map +1 -1
- package/dist/readonlyAugmentedFileSystem.d.ts +0 -2
- package/dist/readonlyAugmentedFileSystem.js.map +1 -1
- package/dist/server.js.map +1 -1
- package/dist/tests/cacheManager.test.js.map +1 -1
- package/dist/tests/chainedSourceFiles.test.js.map +1 -1
- package/dist/tests/checker.test.js +3 -3
- package/dist/tests/checker.test.js.map +1 -1
- package/dist/tests/classDeclaration.test.js.map +1 -1
- package/dist/tests/config.test.js +160 -24
- package/dist/tests/config.test.js.map +1 -1
- package/dist/tests/debug.test.js.map +1 -1
- package/dist/tests/diagnosticOverrides.test.js.map +1 -1
- package/dist/tests/docStringConversion.test.js +1 -2
- package/dist/tests/docStringConversion.test.js.map +1 -1
- package/dist/tests/documentSymbolCollector.test.js.map +1 -1
- package/dist/tests/filesystem.test.js.map +1 -1
- package/dist/tests/fourSlashParser.test.js.map +1 -1
- package/dist/tests/fourSlashRunner.test.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.lib.alias.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.lib.alias.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.builtinOverride.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.classVariable.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.classVariable.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.comment.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.declNames.class.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.declNames.class.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.exception.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.declNames.for.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.declNames.for.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.method.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.declNames.method.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.dunderNew.Inheritance.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.dunderNew.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.enums.members.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.errorNodes.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.excluded.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.fstring.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.import.dunderNames.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.import.exactMatch.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.import.excludeAlreadyImported.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.import.interimFile.fourslash.disabled.d.ts +0 -1
- package/dist/tests/fourslash/completions.import.interimFile.fourslash.disabled.js.map +1 -1
- package/dist/tests/fourslash/completions.import.submodule.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.inList.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.inList.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.included.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.libStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.literals.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.literals.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.localCode.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.overloads.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.override.default.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.override.default.importStub.d.ts +0 -1
- package/dist/tests/fourslash/completions.override.default.imported.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.override.default.stub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.override.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.override.property.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.override.property.stub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.override.stub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.override2.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.override2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.parameters.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.params.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.parentFolder.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.parentFolders.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.parentFolders.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.plainText.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.private.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.private.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.property.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.self.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.triggers.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.triggers.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.typeAlias.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.typeshed.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.vardecls.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.vardecls.fourslash.js.map +1 -1
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/completions.with.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.namespaceImportWithInit.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.namespaceImportWithInit.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.modules.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.modules.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.js.map +1 -1
- package/dist/tests/fourslash/findallreferences.variable.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/findallreferences.variable.fourslash.js.map +1 -1
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.async.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.builtinDocstrings.builtinInheritedByBuiltin.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.builtinDocstrings.builtinInheritedByUserCode.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/hover.class.docString.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.classNoInit.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docFromSrc.stringFormat.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docstring.alias.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docstring.links.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docstring.overloads.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docstring.parameter.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.docstring.split.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.dunderNew.basic.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.dunderNew.inheritance.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.dunderNew.inheritance2.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.dunderNew.overloads.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.dunderNew.withInit.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.formatted.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.import.django.view.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.import.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.inferred.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.init.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.libStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.overloadedFunction.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.plainText.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.slots.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.typedDict.key.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.unpackedTypedDict.key.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.variable.docString.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/import.multipart.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/import.nameconflict.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/import.publicSymbols.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/import.publicSymbols.fourslash.js.map +1 -1
- package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/import.wildcard.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/importnotresolved.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/missingModuleSource.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/missingTypeStub.command.trycatchImport.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/missingTypeStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/noerrors.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/orderImports1.command.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/orderImports2.command.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.args.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.args.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.externallyHidden.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.function.untitledFile.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.function.untitledFile.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.init.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.init.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.library.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.parens.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.parens.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.string.excluded.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.string.excluded.fourslash.js.map +1 -1
- package/dist/tests/fourslash/rename.string.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/rename.string.fourslash.js.map +1 -1
- package/dist/tests/fourslash/shadowedImports.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/showcallhierarchy.incomingCalls.aliasedFunction.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/showcallhierarchy.incomingCalls.aliasedFunction.fourslash.js.map +1 -1
- package/dist/tests/fourslash/showcallhierarchy.incomingCalls.aliasedVariable.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/showcallhierarchy.incomingCalls.aliasedVariable.fourslash.js.map +1 -1
- package/dist/tests/fourslash/showcallhierarchy.incomingCalls.function.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/showcallhierarchy.incomingCalls.function.fourslash.js.map +1 -1
- package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.aliasedFunction1.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.aliasedFunction1.fourslash.js.map +1 -1
- package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.aliasedFunction2.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.aliasedFunction2.fourslash.js.map +1 -1
- package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.function.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/showcallhierarchy.outgoingCalls.function.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.complicated.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/signature.complicated.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.cornercases.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/signature.cornercases.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.docstrings.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/signature.docstrings.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.dunderNew.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/signature.dunderNew.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.overload.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/signature.overload.fourslash.js.map +1 -1
- package/dist/tests/fourslash/signature.simple.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/signature.simple.fourslash.js.map +1 -1
- package/dist/tests/fourslash/typeVerifier.fourslash.d.ts +0 -1
- package/dist/tests/fourslash/typeVerifier.fourslash.js.map +1 -1
- package/dist/tests/harness/fourslash/fourSlashParser.js +1 -2
- package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -1
- package/dist/tests/harness/fourslash/fourSlashTypes.js.map +1 -1
- package/dist/tests/harness/fourslash/runner.d.ts +0 -1
- package/dist/tests/harness/fourslash/runner.js +2 -3
- package/dist/tests/harness/fourslash/runner.js.map +1 -1
- package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.js +7 -7
- package/dist/tests/harness/fourslash/testState.js.map +1 -1
- package/dist/tests/harness/fourslash/testStateUtils.js +4 -5
- package/dist/tests/harness/fourslash/testStateUtils.js.map +1 -1
- package/dist/tests/harness/fourslash/workspaceEditTestUtils.js +7 -8
- package/dist/tests/harness/fourslash/workspaceEditTestUtils.js.map +1 -1
- package/dist/tests/harness/testHost.js.map +1 -1
- package/dist/tests/harness/utils.d.ts +0 -2
- package/dist/tests/harness/utils.js +7 -7
- package/dist/tests/harness/utils.js.map +1 -1
- package/dist/tests/harness/vfs/factory.js +3 -3
- package/dist/tests/harness/vfs/factory.js.map +1 -1
- package/dist/tests/harness/vfs/filesystem.d.ts +0 -2
- package/dist/tests/harness/vfs/filesystem.js +2 -2
- package/dist/tests/harness/vfs/filesystem.js.map +1 -1
- package/dist/tests/harness/vfs/pathValidation.js +2 -2
- package/dist/tests/harness/vfs/pathValidation.js.map +1 -1
- package/dist/tests/importResolver.test.js.map +1 -1
- package/dist/tests/importStatementUtils.test.js.map +1 -1
- package/dist/tests/ipythonMode.test.js.map +1 -1
- package/dist/tests/languageServer.test.js.map +1 -1
- package/dist/tests/localizer.test.js.map +1 -1
- package/dist/tests/lsp/languageServer.js +1 -2
- package/dist/tests/lsp/languageServer.js.map +1 -1
- package/dist/tests/lsp/languageServerTestUtils.js +14 -14
- package/dist/tests/lsp/languageServerTestUtils.js.map +1 -1
- package/dist/tests/lsp/webpack.testserver.config.d.ts +2 -2
- package/dist/tests/parseTreeUtils.test.js.map +1 -1
- package/dist/tests/pathUtils.test.js.map +1 -1
- package/dist/tests/pyrightFileSystem.test.js.map +1 -1
- package/dist/tests/serialization.test.js +1 -2
- package/dist/tests/serialization.test.js.map +1 -1
- package/dist/tests/sourceMapperUtils.test.js.map +1 -1
- package/dist/tests/testStateUtils.js +5 -6
- package/dist/tests/testStateUtils.js.map +1 -1
- package/dist/tests/testUtils.js +8 -9
- package/dist/tests/testUtils.js.map +1 -1
- package/dist/tests/textEditUtil.test.js.map +1 -1
- package/dist/tests/tokenizer.test.js.map +1 -1
- package/dist/tests/typeEvaluator1.test.js +6 -6
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +8 -0
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +2 -2
- package/dist/tests/typeEvaluator4.test.js +6 -2
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typeEvaluator6.test.js +17 -9
- package/dist/tests/typeEvaluator6.test.js.map +1 -1
- package/dist/tests/typeEvaluator7.test.js +2 -2
- package/dist/tests/uri.test.js.map +1 -1
- package/dist/workspaceFactory.js +3 -3
- package/dist/workspaceFactory.js.map +1 -1
- package/package.json +2 -2
@@ -8,9 +8,107 @@
|
|
8
8
|
* Functions that operate on Type objects.
|
9
9
|
*/
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
11
|
-
exports.
|
12
|
-
exports.
|
13
|
-
exports.
|
11
|
+
exports.TypeVarTransformer = exports.UniqueSignatureTracker = exports.AssignTypeFlags = exports.ClassIteratorFlags = exports.MemberAccessFlags = void 0;
|
12
|
+
exports.isOptionalType = isOptionalType;
|
13
|
+
exports.isNoneInstance = isNoneInstance;
|
14
|
+
exports.isNoneTypeClass = isNoneTypeClass;
|
15
|
+
exports.removeNoneFromUnion = removeNoneFromUnion;
|
16
|
+
exports.isIncompleteUnknown = isIncompleteUnknown;
|
17
|
+
exports.isTypeVarSame = isTypeVarSame;
|
18
|
+
exports.makeInferenceContext = makeInferenceContext;
|
19
|
+
exports.mapSubtypes = mapSubtypes;
|
20
|
+
exports.mapSignatures = mapSignatures;
|
21
|
+
exports.cleanIncompleteUnknown = cleanIncompleteUnknown;
|
22
|
+
exports.sortTypes = sortTypes;
|
23
|
+
exports.doForEachSubtype = doForEachSubtype;
|
24
|
+
exports.someSubtypes = someSubtypes;
|
25
|
+
exports.allSubtypes = allSubtypes;
|
26
|
+
exports.doForEachSignature = doForEachSignature;
|
27
|
+
exports.areTypesSame = areTypesSame;
|
28
|
+
exports.preserveUnknown = preserveUnknown;
|
29
|
+
exports.isUnionableType = isUnionableType;
|
30
|
+
exports.derivesFromAnyOrUnknown = derivesFromAnyOrUnknown;
|
31
|
+
exports.getFullNameOfType = getFullNameOfType;
|
32
|
+
exports.addConditionToType = addConditionToType;
|
33
|
+
exports.getTypeCondition = getTypeCondition;
|
34
|
+
exports.isTypeAliasPlaceholder = isTypeAliasPlaceholder;
|
35
|
+
exports.isTypeAliasRecursive = isTypeAliasRecursive;
|
36
|
+
exports.transformPossibleRecursiveTypeAlias = transformPossibleRecursiveTypeAlias;
|
37
|
+
exports.getTypeVarScopeId = getTypeVarScopeId;
|
38
|
+
exports.getTypeVarScopeIds = getTypeVarScopeIds;
|
39
|
+
exports.specializeWithDefaultTypeArgs = specializeWithDefaultTypeArgs;
|
40
|
+
exports.specializeWithUnknownTypeArgs = specializeWithUnknownTypeArgs;
|
41
|
+
exports.getUnknownForTypeVar = getUnknownForTypeVar;
|
42
|
+
exports.getUnknownForTypeVarTuple = getUnknownForTypeVarTuple;
|
43
|
+
exports.getUnknownTypeForCallable = getUnknownTypeForCallable;
|
44
|
+
exports.selfSpecializeClass = selfSpecializeClass;
|
45
|
+
exports.getSpecializedTupleType = getSpecializedTupleType;
|
46
|
+
exports.isLiteralType = isLiteralType;
|
47
|
+
exports.isLiteralTypeOrUnion = isLiteralTypeOrUnion;
|
48
|
+
exports.containsLiteralType = containsLiteralType;
|
49
|
+
exports.getLiteralTypeClassName = getLiteralTypeClassName;
|
50
|
+
exports.getUnionSubtypeCount = getUnionSubtypeCount;
|
51
|
+
exports.isEllipsisType = isEllipsisType;
|
52
|
+
exports.isProperty = isProperty;
|
53
|
+
exports.isCallableType = isCallableType;
|
54
|
+
exports.isDescriptorInstance = isDescriptorInstance;
|
55
|
+
exports.isMaybeDescriptorInstance = isMaybeDescriptorInstance;
|
56
|
+
exports.isTupleGradualForm = isTupleGradualForm;
|
57
|
+
exports.isTupleClass = isTupleClass;
|
58
|
+
exports.isUnboundedTupleClass = isUnboundedTupleClass;
|
59
|
+
exports.isTupleIndexUnambiguous = isTupleIndexUnambiguous;
|
60
|
+
exports.partiallySpecializeType = partiallySpecializeType;
|
61
|
+
exports.addSolutionForSelfType = addSolutionForSelfType;
|
62
|
+
exports.ensureSignaturesAreUnique = ensureSignaturesAreUnique;
|
63
|
+
exports.makeFunctionTypeVarsBound = makeFunctionTypeVarsBound;
|
64
|
+
exports.makeTypeVarsBound = makeTypeVarsBound;
|
65
|
+
exports.makeTypeVarsFree = makeTypeVarsFree;
|
66
|
+
exports.applySolvedTypeVars = applySolvedTypeVars;
|
67
|
+
exports.validateTypeVarDefault = validateTypeVarDefault;
|
68
|
+
exports.transformExpectedType = transformExpectedType;
|
69
|
+
exports.getProtocolSymbols = getProtocolSymbols;
|
70
|
+
exports.getProtocolSymbolsRecursive = getProtocolSymbolsRecursive;
|
71
|
+
exports.getContainerDepth = getContainerDepth;
|
72
|
+
exports.lookUpObjectMember = lookUpObjectMember;
|
73
|
+
exports.lookUpClassMember = lookUpClassMember;
|
74
|
+
exports.getClassMemberIterator = getClassMemberIterator;
|
75
|
+
exports.getClassIterator = getClassIterator;
|
76
|
+
exports.getClassFieldsRecursive = getClassFieldsRecursive;
|
77
|
+
exports.addTypeVarsToListIfUnique = addTypeVarsToListIfUnique;
|
78
|
+
exports.getTypeVarArgsRecursive = getTypeVarArgsRecursive;
|
79
|
+
exports.specializeClassType = specializeClassType;
|
80
|
+
exports.buildSolutionFromSpecializedClass = buildSolutionFromSpecializedClass;
|
81
|
+
exports.buildSolution = buildSolution;
|
82
|
+
exports.specializeForBaseClass = specializeForBaseClass;
|
83
|
+
exports.derivesFromStdlibClass = derivesFromStdlibClass;
|
84
|
+
exports.derivesFromClassRecursive = derivesFromClassRecursive;
|
85
|
+
exports.synthesizeTypeVarForSelfCls = synthesizeTypeVarForSelfCls;
|
86
|
+
exports.getDeclaredGeneratorReturnType = getDeclaredGeneratorReturnType;
|
87
|
+
exports.getGeneratorYieldType = getGeneratorYieldType;
|
88
|
+
exports.isInstantiableMetaclass = isInstantiableMetaclass;
|
89
|
+
exports.isMetaclassInstance = isMetaclassInstance;
|
90
|
+
exports.isEffectivelyInstantiable = isEffectivelyInstantiable;
|
91
|
+
exports.convertToInstance = convertToInstance;
|
92
|
+
exports.convertToInstantiable = convertToInstantiable;
|
93
|
+
exports.getMembersForClass = getMembersForClass;
|
94
|
+
exports.getMembersForModule = getMembersForModule;
|
95
|
+
exports.containsAnyRecursive = containsAnyRecursive;
|
96
|
+
exports.containsAnyOrUnknown = containsAnyOrUnknown;
|
97
|
+
exports.isPartlyUnknown = isPartlyUnknown;
|
98
|
+
exports.explodeGenericClass = explodeGenericClass;
|
99
|
+
exports.combineSameSizedTuples = combineSameSizedTuples;
|
100
|
+
exports.combineTupleTypeArgs = combineTupleTypeArgs;
|
101
|
+
exports.specializeTupleClass = specializeTupleClass;
|
102
|
+
exports.getGeneratorTypeArgs = getGeneratorTypeArgs;
|
103
|
+
exports.requiresTypeArgs = requiresTypeArgs;
|
104
|
+
exports.requiresSpecialization = requiresSpecialization;
|
105
|
+
exports.combineVariances = combineVariances;
|
106
|
+
exports.isVarianceOfTypeArgCompatible = isVarianceOfTypeArgCompatible;
|
107
|
+
exports.computeMroLinearization = computeMroLinearization;
|
108
|
+
exports.getDeclaringModulesForType = getDeclaringModulesForType;
|
109
|
+
exports.convertNodeToArg = convertNodeToArg;
|
110
|
+
exports.convertTypeToParamSpecValue = convertTypeToParamSpecValue;
|
111
|
+
exports.simplifyFunctionToParamSpec = simplifyFunctionToParamSpec;
|
14
112
|
const collectionUtils_1 = require("../common/collectionUtils");
|
15
113
|
const debug_1 = require("../common/debug");
|
16
114
|
const constraintSolution_1 = require("./constraintSolution");
|
@@ -79,11 +177,11 @@ var AssignTypeFlags;
|
|
79
177
|
AssignTypeFlags[AssignTypeFlags["Default"] = 0] = "Default";
|
80
178
|
// Require invariance with respect to class matching? Normally
|
81
179
|
// subclasses are allowed.
|
82
|
-
AssignTypeFlags[AssignTypeFlags["
|
180
|
+
AssignTypeFlags[AssignTypeFlags["Invariant"] = 1] = "Invariant";
|
83
181
|
// The caller has swapped the source and dest types because
|
84
182
|
// the types are contravariant. Perform type var matching
|
85
183
|
// on dest type vars rather than source type var.
|
86
|
-
AssignTypeFlags[AssignTypeFlags["
|
184
|
+
AssignTypeFlags[AssignTypeFlags["Contravariant"] = 2] = "Contravariant";
|
87
185
|
// We're comparing type compatibility of two distinct recursive types.
|
88
186
|
// This has the potential of recursing infinitely. This flag allows us
|
89
187
|
// to detect the recursion after the first level of checking.
|
@@ -113,8 +211,9 @@ var AssignTypeFlags;
|
|
113
211
|
AssignTypeFlags[AssignTypeFlags["SkipSelfClsTypeCheck"] = 512] = "SkipSelfClsTypeCheck";
|
114
212
|
// We're initially populating the constraints with an expected type,
|
115
213
|
// so TypeVars should match the specified type exactly rather than
|
116
|
-
// employing narrowing or widening
|
117
|
-
|
214
|
+
// employing narrowing or widening. The variance context determines
|
215
|
+
// whether the upper bound, lower bound, or both are established.
|
216
|
+
AssignTypeFlags[AssignTypeFlags["PopulateExpectedType"] = 2048] = "PopulateExpectedType";
|
118
217
|
// Used with PopulatingExpectedType, this flag indicates that a TypeVar
|
119
218
|
// constraint that is Unknown should be ignored.
|
120
219
|
AssignTypeFlags[AssignTypeFlags["SkipPopulateUnknownExpectedType"] = 4096] = "SkipPopulateUnknownExpectedType";
|
@@ -183,25 +282,20 @@ function isOptionalType(type) {
|
|
183
282
|
}
|
184
283
|
return false;
|
185
284
|
}
|
186
|
-
exports.isOptionalType = isOptionalType;
|
187
285
|
function isNoneInstance(type) {
|
188
286
|
return (0, types_1.isClassInstance)(type) && types_1.ClassType.isBuiltIn(type, 'NoneType');
|
189
287
|
}
|
190
|
-
exports.isNoneInstance = isNoneInstance;
|
191
288
|
function isNoneTypeClass(type) {
|
192
289
|
return (0, types_1.isInstantiableClass)(type) && types_1.ClassType.isBuiltIn(type, 'NoneType');
|
193
290
|
}
|
194
|
-
exports.isNoneTypeClass = isNoneTypeClass;
|
195
291
|
// If the type is a union, remove an "None" type from the union,
|
196
292
|
// returning only the known types.
|
197
293
|
function removeNoneFromUnion(type) {
|
198
294
|
return (0, types_1.removeFromUnion)(type, (t) => isNoneInstance(t));
|
199
295
|
}
|
200
|
-
exports.removeNoneFromUnion = removeNoneFromUnion;
|
201
296
|
function isIncompleteUnknown(type) {
|
202
297
|
return (0, types_1.isUnknown)(type) && type.priv.isIncomplete;
|
203
298
|
}
|
204
|
-
exports.isIncompleteUnknown = isIncompleteUnknown;
|
205
299
|
// Similar to isTypeSame except that type1 is a TypeVar and type2
|
206
300
|
// can be either a TypeVar of the same type or a union that includes
|
207
301
|
// conditional types associated with that bound TypeVar.
|
@@ -232,14 +326,12 @@ function isTypeVarSame(type1, type2) {
|
|
232
326
|
});
|
233
327
|
return isCompatible;
|
234
328
|
}
|
235
|
-
exports.isTypeVarSame = isTypeVarSame;
|
236
329
|
function makeInferenceContext(expectedType, isTypeIncomplete, returnTypeOverride) {
|
237
330
|
if (!expectedType) {
|
238
331
|
return undefined;
|
239
332
|
}
|
240
333
|
return { expectedType, isTypeIncomplete, returnTypeOverride };
|
241
334
|
}
|
242
|
-
exports.makeInferenceContext = makeInferenceContext;
|
243
335
|
// Calls a callback for each subtype and combines the results
|
244
336
|
// into a final type. It performs no memory allocations if the
|
245
337
|
// transformed type is the same as the original.
|
@@ -288,7 +380,6 @@ function mapSubtypes(type, callback, options) {
|
|
288
380
|
}
|
289
381
|
return transformedSubtype;
|
290
382
|
}
|
291
|
-
exports.mapSubtypes = mapSubtypes;
|
292
383
|
// Iterates over each signature in a function or overload, allowing the
|
293
384
|
// caller to replace one or more signatures with new ones.
|
294
385
|
function mapSignatures(type, callback) {
|
@@ -297,7 +388,7 @@ function mapSignatures(type, callback) {
|
|
297
388
|
}
|
298
389
|
const newSignatures = [];
|
299
390
|
let changeMade = false;
|
300
|
-
types_1.
|
391
|
+
types_1.OverloadedType.getOverloads(type).forEach((overload, index) => {
|
301
392
|
const newOverload = callback(overload);
|
302
393
|
if (newOverload !== overload) {
|
303
394
|
changeMade = true;
|
@@ -310,12 +401,12 @@ function mapSignatures(type, callback) {
|
|
310
401
|
return undefined;
|
311
402
|
}
|
312
403
|
// Add the unmodified implementation if it's present.
|
313
|
-
const implementation = types_1.
|
314
|
-
|
315
|
-
|
404
|
+
const implementation = types_1.OverloadedType.getImplementation(type);
|
405
|
+
let newImplementation = implementation;
|
406
|
+
if (implementation && (0, types_1.isFunction)(implementation)) {
|
407
|
+
newImplementation = callback(implementation);
|
316
408
|
if (newImplementation) {
|
317
409
|
changeMade = true;
|
318
|
-
newSignatures.push(newImplementation);
|
319
410
|
}
|
320
411
|
}
|
321
412
|
if (!changeMade) {
|
@@ -324,9 +415,8 @@ function mapSignatures(type, callback) {
|
|
324
415
|
if (newSignatures.length === 1) {
|
325
416
|
return newSignatures[0];
|
326
417
|
}
|
327
|
-
return types_1.
|
418
|
+
return types_1.OverloadedType.create(newSignatures, newImplementation);
|
328
419
|
}
|
329
|
-
exports.mapSignatures = mapSignatures;
|
330
420
|
// The code flow engine uses a special form of the UnknownType (with the
|
331
421
|
// isIncomplete flag set) to distinguish between an unknown that was generated
|
332
422
|
// in a loop because it was temporarily incomplete versus an unknown that is
|
@@ -380,14 +470,12 @@ function cleanIncompleteUnknown(type, recursionCount = 0) {
|
|
380
470
|
// If we eliminated everything, don't return a Never.
|
381
471
|
return (0, types_1.isNever)(result) ? type : result;
|
382
472
|
}
|
383
|
-
exports.cleanIncompleteUnknown = cleanIncompleteUnknown;
|
384
473
|
// Sorts types into a deterministic order.
|
385
474
|
function sortTypes(types) {
|
386
475
|
return types.slice(0).sort((a, b) => {
|
387
476
|
return compareTypes(a, b);
|
388
477
|
});
|
389
478
|
}
|
390
|
-
exports.sortTypes = sortTypes;
|
391
479
|
function compareTypes(a, b, recursionCount = 0) {
|
392
480
|
var _a, _b;
|
393
481
|
if (recursionCount > types_1.maxTypeRecursionCount) {
|
@@ -437,15 +525,17 @@ function compareTypes(a, b, recursionCount = 0) {
|
|
437
525
|
}
|
438
526
|
return 0;
|
439
527
|
}
|
440
|
-
case 5 /* TypeCategory.
|
528
|
+
case 5 /* TypeCategory.Overloaded */: {
|
441
529
|
const bOver = b;
|
442
|
-
const
|
443
|
-
const
|
530
|
+
const aOverloads = types_1.OverloadedType.getOverloads(a);
|
531
|
+
const bOverloads = types_1.OverloadedType.getOverloads(bOver);
|
532
|
+
const aOverloadCount = aOverloads.length;
|
533
|
+
const bOverloadCount = bOverloads.length;
|
444
534
|
if (aOverloadCount !== bOverloadCount) {
|
445
535
|
return bOverloadCount - aOverloadCount;
|
446
536
|
}
|
447
537
|
for (let i = 0; i < aOverloadCount; i++) {
|
448
|
-
const typeComparison = compareTypes(
|
538
|
+
const typeComparison = compareTypes(aOverloads[i], bOverloads[i]);
|
449
539
|
if (typeComparison !== 0) {
|
450
540
|
return typeComparison;
|
451
541
|
}
|
@@ -537,7 +627,6 @@ function doForEachSubtype(type, callback, sortSubtypes = false) {
|
|
537
627
|
callback(type, 0, [type]);
|
538
628
|
}
|
539
629
|
}
|
540
|
-
exports.doForEachSubtype = doForEachSubtype;
|
541
630
|
function someSubtypes(type, callback) {
|
542
631
|
if ((0, types_1.isUnion)(type)) {
|
543
632
|
return type.priv.subtypes.some((subtype) => {
|
@@ -548,7 +637,6 @@ function someSubtypes(type, callback) {
|
|
548
637
|
return callback(type);
|
549
638
|
}
|
550
639
|
}
|
551
|
-
exports.someSubtypes = someSubtypes;
|
552
640
|
function allSubtypes(type, callback) {
|
553
641
|
if ((0, types_1.isUnion)(type)) {
|
554
642
|
return type.priv.subtypes.every((subtype) => {
|
@@ -559,18 +647,16 @@ function allSubtypes(type, callback) {
|
|
559
647
|
return callback(type);
|
560
648
|
}
|
561
649
|
}
|
562
|
-
exports.allSubtypes = allSubtypes;
|
563
650
|
function doForEachSignature(type, callback) {
|
564
651
|
if ((0, types_1.isFunction)(type)) {
|
565
652
|
callback(type, 0);
|
566
653
|
}
|
567
654
|
else {
|
568
|
-
types_1.
|
655
|
+
types_1.OverloadedType.getOverloads(type).forEach((overload, index) => {
|
569
656
|
callback(overload, index);
|
570
657
|
});
|
571
658
|
}
|
572
659
|
}
|
573
|
-
exports.doForEachSignature = doForEachSignature;
|
574
660
|
// Determines if all of the types in the array are the same.
|
575
661
|
function areTypesSame(types, options) {
|
576
662
|
if (types.length < 2) {
|
@@ -583,7 +669,6 @@ function areTypesSame(types, options) {
|
|
583
669
|
}
|
584
670
|
return true;
|
585
671
|
}
|
586
|
-
exports.areTypesSame = areTypesSame;
|
587
672
|
// If either type is "Unknown" (versus Any), propagate the Unknown. Preserve
|
588
673
|
// the incomplete flag on the unknown if present. The caller should verify that
|
589
674
|
// one or the other type is Unknown or Any.
|
@@ -601,7 +686,6 @@ function preserveUnknown(type1, type2) {
|
|
601
686
|
return types_1.AnyType.create();
|
602
687
|
}
|
603
688
|
}
|
604
|
-
exports.preserveUnknown = preserveUnknown;
|
605
689
|
// Determines whether the specified type is a type that can be
|
606
690
|
// combined with other types for a union.
|
607
691
|
function isUnionableType(subtypes) {
|
@@ -615,7 +699,6 @@ function isUnionableType(subtypes) {
|
|
615
699
|
// be definitively instantiable (not an instance).
|
616
700
|
return (typeFlags & 1 /* TypeFlags.Instantiable */) !== 0 && (typeFlags & 2 /* TypeFlags.Instance */) === 0;
|
617
701
|
}
|
618
|
-
exports.isUnionableType = isUnionableType;
|
619
702
|
function derivesFromAnyOrUnknown(type) {
|
620
703
|
let anyOrUnknown = false;
|
621
704
|
doForEachSubtype(type, (subtype) => {
|
@@ -635,7 +718,6 @@ function derivesFromAnyOrUnknown(type) {
|
|
635
718
|
});
|
636
719
|
return anyOrUnknown;
|
637
720
|
}
|
638
|
-
exports.derivesFromAnyOrUnknown = derivesFromAnyOrUnknown;
|
639
721
|
function getFullNameOfType(type) {
|
640
722
|
var _a, _b;
|
641
723
|
if ((_b = (_a = type.props) === null || _a === void 0 ? void 0 : _a.typeAliasInfo) === null || _b === void 0 ? void 0 : _b.fullName) {
|
@@ -651,12 +733,19 @@ function getFullNameOfType(type) {
|
|
651
733
|
return type.shared.fullName;
|
652
734
|
case 7 /* TypeCategory.Module */:
|
653
735
|
return type.priv.moduleName;
|
654
|
-
case 5 /* TypeCategory.
|
655
|
-
|
736
|
+
case 5 /* TypeCategory.Overloaded */: {
|
737
|
+
const overloads = types_1.OverloadedType.getOverloads(type);
|
738
|
+
if (overloads.length > 0) {
|
739
|
+
return overloads[0].shared.fullName;
|
740
|
+
}
|
741
|
+
const impl = types_1.OverloadedType.getImplementation(type);
|
742
|
+
if (impl && (0, types_1.isFunction)(impl)) {
|
743
|
+
return impl.shared.fullName;
|
744
|
+
}
|
745
|
+
}
|
656
746
|
}
|
657
747
|
return undefined;
|
658
748
|
}
|
659
|
-
exports.getFullNameOfType = getFullNameOfType;
|
660
749
|
function addConditionToType(type, condition, skipSelfCondition = false) {
|
661
750
|
var _a, _b;
|
662
751
|
if (!condition) {
|
@@ -678,15 +767,14 @@ function addConditionToType(type, condition, skipSelfCondition = false) {
|
|
678
767
|
return type;
|
679
768
|
case 4 /* TypeCategory.Function */:
|
680
769
|
return types_1.TypeBase.cloneForCondition(type, types_1.TypeCondition.combine((_a = type.props) === null || _a === void 0 ? void 0 : _a.condition, condition));
|
681
|
-
case 5 /* TypeCategory.
|
682
|
-
return types_1.
|
770
|
+
case 5 /* TypeCategory.Overloaded */:
|
771
|
+
return types_1.OverloadedType.create(types_1.OverloadedType.getOverloads(type).map((t) => addConditionToType(t, condition)));
|
683
772
|
case 6 /* TypeCategory.Class */:
|
684
773
|
return types_1.TypeBase.cloneForCondition(type, types_1.TypeCondition.combine((_b = type.props) === null || _b === void 0 ? void 0 : _b.condition, condition));
|
685
774
|
case 8 /* TypeCategory.Union */:
|
686
775
|
return (0, types_1.combineTypes)(type.priv.subtypes.map((t) => addConditionToType(t, condition)));
|
687
776
|
}
|
688
777
|
}
|
689
|
-
exports.addConditionToType = addConditionToType;
|
690
778
|
function getTypeCondition(type) {
|
691
779
|
var _a;
|
692
780
|
switch (type.category) {
|
@@ -696,7 +784,7 @@ function getTypeCondition(type) {
|
|
696
784
|
case 3 /* TypeCategory.Never */:
|
697
785
|
case 7 /* TypeCategory.Module */:
|
698
786
|
case 9 /* TypeCategory.TypeVar */:
|
699
|
-
case 5 /* TypeCategory.
|
787
|
+
case 5 /* TypeCategory.Overloaded */:
|
700
788
|
case 8 /* TypeCategory.Union */:
|
701
789
|
return undefined;
|
702
790
|
case 6 /* TypeCategory.Class */:
|
@@ -704,13 +792,11 @@ function getTypeCondition(type) {
|
|
704
792
|
return (_a = type.props) === null || _a === void 0 ? void 0 : _a.condition;
|
705
793
|
}
|
706
794
|
}
|
707
|
-
exports.getTypeCondition = getTypeCondition;
|
708
795
|
// Indicates whether the specified type is a recursive type alias
|
709
796
|
// placeholder that has not yet been resolved.
|
710
797
|
function isTypeAliasPlaceholder(type) {
|
711
798
|
return (0, types_1.isTypeVar)(type) && types_1.TypeVarType.isTypeAliasPlaceholder(type);
|
712
799
|
}
|
713
|
-
exports.isTypeAliasPlaceholder = isTypeAliasPlaceholder;
|
714
800
|
// Determines whether the type alias placeholder is used directly
|
715
801
|
// within the specified type. It's OK if it's used indirectly as
|
716
802
|
// a type argument.
|
@@ -729,7 +815,6 @@ function isTypeAliasRecursive(typeAliasPlaceholder, type) {
|
|
729
815
|
return ((0, types_1.findSubtype)(type, (subtype) => (0, types_1.isTypeVar)(subtype) && subtype.shared === typeAliasPlaceholder.shared) !==
|
730
816
|
undefined);
|
731
817
|
}
|
732
|
-
exports.isTypeAliasRecursive = isTypeAliasRecursive;
|
733
818
|
function transformPossibleRecursiveTypeAlias(type) {
|
734
819
|
var _a, _b;
|
735
820
|
if (type) {
|
@@ -755,7 +840,6 @@ function transformPossibleRecursiveTypeAlias(type) {
|
|
755
840
|
}
|
756
841
|
return type;
|
757
842
|
}
|
758
|
-
exports.transformPossibleRecursiveTypeAlias = transformPossibleRecursiveTypeAlias;
|
759
843
|
function getTypeVarScopeId(type) {
|
760
844
|
if ((0, types_1.isClass)(type)) {
|
761
845
|
return type.shared.typeVarScopeId;
|
@@ -768,7 +852,6 @@ function getTypeVarScopeId(type) {
|
|
768
852
|
}
|
769
853
|
return undefined;
|
770
854
|
}
|
771
|
-
exports.getTypeVarScopeId = getTypeVarScopeId;
|
772
855
|
// This is similar to getTypeVarScopeId except that it includes
|
773
856
|
// the secondary scope IDs for functions.
|
774
857
|
function getTypeVarScopeIds(type) {
|
@@ -784,7 +867,6 @@ function getTypeVarScopeIds(type) {
|
|
784
867
|
}
|
785
868
|
return scopeIds;
|
786
869
|
}
|
787
|
-
exports.getTypeVarScopeIds = getTypeVarScopeIds;
|
788
870
|
// If the class type is generic and does not already have type arguments
|
789
871
|
// specified, specialize it with default type arguments (Unknown or the
|
790
872
|
// default type if provided).
|
@@ -796,7 +878,6 @@ function specializeWithDefaultTypeArgs(type) {
|
|
796
878
|
/* isTypeArgExplicit */ false,
|
797
879
|
/* includeSubclasses */ type.priv.includeSubclasses);
|
798
880
|
}
|
799
|
-
exports.specializeWithDefaultTypeArgs = specializeWithDefaultTypeArgs;
|
800
881
|
// Specializes the class with "Unknown" type args (or the equivalent for ParamSpecs
|
801
882
|
// or TypeVarTuples).
|
802
883
|
function specializeWithUnknownTypeArgs(type, tupleClassType) {
|
@@ -811,7 +892,6 @@ function specializeWithUnknownTypeArgs(type, tupleClassType) {
|
|
811
892
|
/* isTypeArgExplicit */ false,
|
812
893
|
/* includeSubclasses */ type.priv.includeSubclasses);
|
813
894
|
}
|
814
|
-
exports.specializeWithUnknownTypeArgs = specializeWithUnknownTypeArgs;
|
815
895
|
// Returns "Unknown" for simple TypeVars or the equivalent for a ParamSpec.
|
816
896
|
function getUnknownForTypeVar(typeVar, tupleClassType) {
|
817
897
|
if ((0, types_1.isParamSpec)(typeVar)) {
|
@@ -822,14 +902,12 @@ function getUnknownForTypeVar(typeVar, tupleClassType) {
|
|
822
902
|
}
|
823
903
|
return types_1.UnknownType.create();
|
824
904
|
}
|
825
|
-
exports.getUnknownForTypeVar = getUnknownForTypeVar;
|
826
905
|
function getUnknownForTypeVarTuple(tupleClassType) {
|
827
906
|
(0, debug_1.assert)((0, types_1.isInstantiableClass)(tupleClassType) && types_1.ClassType.isBuiltIn(tupleClassType, 'tuple'));
|
828
907
|
return types_1.ClassType.cloneAsInstance(specializeTupleClass(tupleClassType, [{ type: types_1.UnknownType.create(), isUnbounded: true }],
|
829
908
|
/* isTypeArgExplicit */ true,
|
830
|
-
/*
|
909
|
+
/* isUnpacked */ true));
|
831
910
|
}
|
832
|
-
exports.getUnknownForTypeVarTuple = getUnknownForTypeVarTuple;
|
833
911
|
// Returns the equivalent of "Callable[..., Unknown]".
|
834
912
|
function getUnknownTypeForCallable() {
|
835
913
|
const newFunction = types_1.FunctionType.createSynthesizedInstance('', 32768 /* FunctionTypeFlags.GradualCallableForm */);
|
@@ -837,7 +915,6 @@ function getUnknownTypeForCallable() {
|
|
837
915
|
newFunction.shared.declaredReturnType = types_1.UnknownType.create();
|
838
916
|
return newFunction;
|
839
917
|
}
|
840
|
-
exports.getUnknownTypeForCallable = getUnknownTypeForCallable;
|
841
918
|
// If the class is generic and not already specialized, this function
|
842
919
|
// "self specializes" the class, filling in its own type parameters
|
843
920
|
// as type arguments.
|
@@ -853,7 +930,6 @@ function selfSpecializeClass(type, options) {
|
|
853
930
|
});
|
854
931
|
return types_1.ClassType.specialize(type, typeParams);
|
855
932
|
}
|
856
|
-
exports.selfSpecializeClass = selfSpecializeClass;
|
857
933
|
// Determines whether the type derives from tuple. If so, it returns
|
858
934
|
// the specialized tuple type.
|
859
935
|
function getSpecializedTupleType(type) {
|
@@ -879,11 +955,9 @@ function getSpecializedTupleType(type) {
|
|
879
955
|
const solution = buildSolutionFromSpecializedClass(classType);
|
880
956
|
return applySolvedTypeVars(tupleClass, solution);
|
881
957
|
}
|
882
|
-
exports.getSpecializedTupleType = getSpecializedTupleType;
|
883
958
|
function isLiteralType(type) {
|
884
959
|
return types_1.TypeBase.isInstance(type) && type.priv.literalValue !== undefined;
|
885
960
|
}
|
886
|
-
exports.isLiteralType = isLiteralType;
|
887
961
|
function isLiteralTypeOrUnion(type, allowNone = false) {
|
888
962
|
if ((0, types_1.isClassInstance)(type)) {
|
889
963
|
if (allowNone && isNoneInstance(type)) {
|
@@ -904,7 +978,6 @@ function isLiteralTypeOrUnion(type, allowNone = false) {
|
|
904
978
|
}
|
905
979
|
return false;
|
906
980
|
}
|
907
|
-
exports.isLiteralTypeOrUnion = isLiteralTypeOrUnion;
|
908
981
|
function containsLiteralType(type, includeTypeArgs = false) {
|
909
982
|
class ContainsLiteralTypeWalker extends typeWalker_1.TypeWalker {
|
910
983
|
constructor(_includeTypeArgs) {
|
@@ -928,7 +1001,6 @@ function containsLiteralType(type, includeTypeArgs = false) {
|
|
928
1001
|
walker.walk(type);
|
929
1002
|
return walker.foundLiteral;
|
930
1003
|
}
|
931
|
-
exports.containsLiteralType = containsLiteralType;
|
932
1004
|
// If all of the subtypes are literals with the same built-in class (e.g.
|
933
1005
|
// all 'int' or all 'str'), this function returns the name of that type. If
|
934
1006
|
// some of the subtypes are not literals or the literal classes don't match,
|
@@ -956,24 +1028,20 @@ function getLiteralTypeClassName(type) {
|
|
956
1028
|
}
|
957
1029
|
return undefined;
|
958
1030
|
}
|
959
|
-
exports.getLiteralTypeClassName = getLiteralTypeClassName;
|
960
1031
|
function getUnionSubtypeCount(type) {
|
961
1032
|
if ((0, types_1.isUnion)(type)) {
|
962
1033
|
return type.priv.subtypes.length;
|
963
1034
|
}
|
964
1035
|
return 1;
|
965
1036
|
}
|
966
|
-
exports.getUnionSubtypeCount = getUnionSubtypeCount;
|
967
1037
|
function isEllipsisType(type) {
|
968
1038
|
return (0, types_1.isAny)(type) && type.priv.isEllipsis;
|
969
1039
|
}
|
970
|
-
exports.isEllipsisType = isEllipsisType;
|
971
1040
|
function isProperty(type) {
|
972
1041
|
return (0, types_1.isClassInstance)(type) && types_1.ClassType.isPropertyClass(type);
|
973
1042
|
}
|
974
|
-
exports.isProperty = isProperty;
|
975
1043
|
function isCallableType(type) {
|
976
|
-
if ((0, types_1.isFunction)(type) || (0, types_1.
|
1044
|
+
if ((0, types_1.isFunction)(type) || (0, types_1.isOverloaded)(type) || (0, types_1.isAnyOrUnknown)(type)) {
|
977
1045
|
return true;
|
978
1046
|
}
|
979
1047
|
if (isEffectivelyInstantiable(type)) {
|
@@ -991,14 +1059,12 @@ function isCallableType(type) {
|
|
991
1059
|
}
|
992
1060
|
return false;
|
993
1061
|
}
|
994
|
-
exports.isCallableType = isCallableType;
|
995
1062
|
function isDescriptorInstance(type, requireSetter = false) {
|
996
1063
|
if ((0, types_1.isUnion)(type)) {
|
997
1064
|
return type.priv.subtypes.every((subtype) => isMaybeDescriptorInstance(subtype, requireSetter));
|
998
1065
|
}
|
999
1066
|
return isMaybeDescriptorInstance(type, requireSetter);
|
1000
1067
|
}
|
1001
|
-
exports.isDescriptorInstance = isDescriptorInstance;
|
1002
1068
|
function isMaybeDescriptorInstance(type, requireSetter = false) {
|
1003
1069
|
if ((0, types_1.isUnion)(type)) {
|
1004
1070
|
return type.priv.subtypes.some((subtype) => isMaybeDescriptorInstance(subtype, requireSetter));
|
@@ -1014,7 +1080,6 @@ function isMaybeDescriptorInstance(type, requireSetter = false) {
|
|
1014
1080
|
}
|
1015
1081
|
return true;
|
1016
1082
|
}
|
1017
|
-
exports.isMaybeDescriptorInstance = isMaybeDescriptorInstance;
|
1018
1083
|
function isTupleGradualForm(type) {
|
1019
1084
|
return ((0, types_1.isClassInstance)(type) &&
|
1020
1085
|
isTupleClass(type) &&
|
@@ -1023,11 +1088,9 @@ function isTupleGradualForm(type) {
|
|
1023
1088
|
(0, types_1.isAnyOrUnknown)(type.priv.tupleTypeArgs[0].type) &&
|
1024
1089
|
type.priv.tupleTypeArgs[0].isUnbounded);
|
1025
1090
|
}
|
1026
|
-
exports.isTupleGradualForm = isTupleGradualForm;
|
1027
1091
|
function isTupleClass(type) {
|
1028
1092
|
return types_1.ClassType.isBuiltIn(type, 'tuple');
|
1029
1093
|
}
|
1030
|
-
exports.isTupleClass = isTupleClass;
|
1031
1094
|
// Indicates whether the type is a tuple class of
|
1032
1095
|
// the form tuple[x, ...] where the number of elements
|
1033
1096
|
// in the tuple is unknown.
|
@@ -1035,7 +1098,6 @@ function isUnboundedTupleClass(type) {
|
|
1035
1098
|
var _a;
|
1036
1099
|
return (_a = type.priv.tupleTypeArgs) === null || _a === void 0 ? void 0 : _a.some((t) => t.isUnbounded || (0, types_1.isUnpackedTypeVarTuple)(t.type));
|
1037
1100
|
}
|
1038
|
-
exports.isUnboundedTupleClass = isUnboundedTupleClass;
|
1039
1101
|
// Indicates whether the specified index is within range and its type is unambiguous
|
1040
1102
|
// in that it doesn't involve any element ranges that are of indeterminate length.
|
1041
1103
|
function isTupleIndexUnambiguous(type, index) {
|
@@ -1051,7 +1113,6 @@ function isTupleIndexUnambiguous(type, index) {
|
|
1051
1113
|
const upperIndexLimit = unboundedIndex < 0 ? type.priv.tupleTypeArgs.length : unboundedIndex;
|
1052
1114
|
return index < upperIndexLimit;
|
1053
1115
|
}
|
1054
|
-
exports.isTupleIndexUnambiguous = isTupleIndexUnambiguous;
|
1055
1116
|
// Partially specializes a type within the context of a specified
|
1056
1117
|
// (presumably specialized) class. Optionally specializes the `Self`
|
1057
1118
|
// type variables, replacing them with selfClass.
|
@@ -1088,7 +1149,6 @@ function partiallySpecializeType(type, contextClassType, typeClassType, selfClas
|
|
1088
1149
|
}
|
1089
1150
|
return result;
|
1090
1151
|
}
|
1091
|
-
exports.partiallySpecializeType = partiallySpecializeType;
|
1092
1152
|
function addSolutionForSelfType(solution, contextClassType, selfClass) {
|
1093
1153
|
const synthesizedSelfTypeVar = synthesizeTypeVarForSelfCls(contextClassType, /* isClsParam */ false);
|
1094
1154
|
const selfInstance = convertToInstance(selfClass);
|
@@ -1104,24 +1164,30 @@ function addSolutionForSelfType(solution, contextClassType, selfClass) {
|
|
1104
1164
|
});
|
1105
1165
|
solution.setType(synthesizedSelfTypeVar, selfWithoutLiteral);
|
1106
1166
|
}
|
1107
|
-
exports.addSolutionForSelfType = addSolutionForSelfType;
|
1108
1167
|
// Looks for duplicate function types within the type and ensures that
|
1109
1168
|
// if they are generic, they have unique type variables.
|
1110
1169
|
function ensureSignaturesAreUnique(type, signatureTracker, expressionOffset) {
|
1111
1170
|
const transformer = new UniqueFunctionSignatureTransformer(signatureTracker, expressionOffset);
|
1112
1171
|
return transformer.apply(type, 0);
|
1113
1172
|
}
|
1114
|
-
|
1173
|
+
function makeFunctionTypeVarsBound(type) {
|
1174
|
+
const scopeIds = [];
|
1175
|
+
doForEachSignature(type, (signature) => {
|
1176
|
+
const localScopeId = getTypeVarScopeId(signature);
|
1177
|
+
if (localScopeId) {
|
1178
|
+
scopeIds.push(localScopeId);
|
1179
|
+
}
|
1180
|
+
});
|
1181
|
+
return makeTypeVarsBound(type, scopeIds);
|
1182
|
+
}
|
1115
1183
|
function makeTypeVarsBound(type, scopeIds) {
|
1116
1184
|
const transformer = new BoundTypeVarTransform(scopeIds);
|
1117
1185
|
return transformer.apply(type, 0);
|
1118
1186
|
}
|
1119
|
-
exports.makeTypeVarsBound = makeTypeVarsBound;
|
1120
1187
|
function makeTypeVarsFree(type, scopeIds) {
|
1121
1188
|
const transformer = new FreeTypeVarTransform(scopeIds);
|
1122
1189
|
return transformer.apply(type, 0);
|
1123
1190
|
}
|
1124
|
-
exports.makeTypeVarsFree = makeTypeVarsFree;
|
1125
1191
|
// Specializes a (potentially generic) type by substituting
|
1126
1192
|
// type variables from a type var map.
|
1127
1193
|
function applySolvedTypeVars(type, solution, options = {}) {
|
@@ -1132,28 +1198,6 @@ function applySolvedTypeVars(type, solution, options = {}) {
|
|
1132
1198
|
const transformer = new ApplySolvedTypeVarsTransformer(solution, options);
|
1133
1199
|
return transformer.apply(type, 0);
|
1134
1200
|
}
|
1135
|
-
exports.applySolvedTypeVars = applySolvedTypeVars;
|
1136
|
-
// Applies solved TypeVars from one context to this context.
|
1137
|
-
function applySourceContextTypeVars(destContext, srcSolution) {
|
1138
|
-
if (srcSolution.isEmpty()) {
|
1139
|
-
return;
|
1140
|
-
}
|
1141
|
-
destContext.doForEachConstraintSet((set) => {
|
1142
|
-
applySourceContextTypeVarsToSignature(set, srcSolution);
|
1143
|
-
});
|
1144
|
-
}
|
1145
|
-
exports.applySourceContextTypeVars = applySourceContextTypeVars;
|
1146
|
-
function applySourceContextTypeVarsToSignature(set, srcSolution) {
|
1147
|
-
set.getTypeVars().forEach((entry) => {
|
1148
|
-
const newLowerBound = entry.lowerBound ? applySolvedTypeVars(entry.lowerBound, srcSolution) : undefined;
|
1149
|
-
const newLowerBoundNoLiterals = entry.lowerBoundNoLiterals
|
1150
|
-
? applySolvedTypeVars(entry.lowerBoundNoLiterals, srcSolution)
|
1151
|
-
: undefined;
|
1152
|
-
const newUpperBound = entry.upperBound ? applySolvedTypeVars(entry.upperBound, srcSolution) : undefined;
|
1153
|
-
set.setBounds(entry.typeVar, newLowerBound, newLowerBoundNoLiterals, newUpperBound);
|
1154
|
-
});
|
1155
|
-
}
|
1156
|
-
exports.applySourceContextTypeVarsToSignature = applySourceContextTypeVarsToSignature;
|
1157
1201
|
// Validates that a default type associated with a TypeVar does not refer to
|
1158
1202
|
// other TypeVars or ParamSpecs that are out of scope.
|
1159
1203
|
function validateTypeVarDefault(typeVar, liveTypeParams, invalidTypeVars) {
|
@@ -1164,7 +1208,6 @@ function validateTypeVarDefault(typeVar, liveTypeParams, invalidTypeVars) {
|
|
1164
1208
|
validator.apply(typeVar.shared.defaultType, 0);
|
1165
1209
|
}
|
1166
1210
|
}
|
1167
|
-
exports.validateTypeVarDefault = validateTypeVarDefault;
|
1168
1211
|
// During bidirectional type inference for constructors, an "expected type"
|
1169
1212
|
// is used to prepopulate the type var map. This is problematic when the
|
1170
1213
|
// expected type uses TypeVars that are not part of the context of the
|
@@ -1174,7 +1217,6 @@ function transformExpectedType(expectedType, liveTypeVarScopes, usageOffset) {
|
|
1174
1217
|
const transformer = new ExpectedTypeTransformer(liveTypeVarScopes, usageOffset);
|
1175
1218
|
return transformer.apply(expectedType, 0);
|
1176
1219
|
}
|
1177
|
-
exports.transformExpectedType = transformExpectedType;
|
1178
1220
|
// Given a protocol class (or abstract class), this function returns
|
1179
1221
|
// a set of all the symbols (indexed by symbol name) that are part of
|
1180
1222
|
// that protocol and its protocol parent classes. If a same-named symbol
|
@@ -1186,7 +1228,6 @@ function getProtocolSymbols(classType) {
|
|
1186
1228
|
}
|
1187
1229
|
return symbolMap;
|
1188
1230
|
}
|
1189
|
-
exports.getProtocolSymbols = getProtocolSymbols;
|
1190
1231
|
function getProtocolSymbolsRecursive(classType, symbolMap, classFlags = 512 /* ClassTypeFlags.ProtocolClass */, recursionCount = 0) {
|
1191
1232
|
if (recursionCount > types_1.maxTypeRecursionCount) {
|
1192
1233
|
return;
|
@@ -1211,7 +1252,6 @@ function getProtocolSymbolsRecursive(classType, symbolMap, classFlags = 512 /* C
|
|
1211
1252
|
}
|
1212
1253
|
});
|
1213
1254
|
}
|
1214
|
-
exports.getProtocolSymbolsRecursive = getProtocolSymbolsRecursive;
|
1215
1255
|
// Determines the maximum depth of a tuple, list, set or dictionary.
|
1216
1256
|
// For example, if the type is tuple[tuple[tuple[int]]], its depth would be 3.
|
1217
1257
|
function getContainerDepth(type, recursionCount = 0) {
|
@@ -1244,14 +1284,12 @@ function getContainerDepth(type, recursionCount = 0) {
|
|
1244
1284
|
}
|
1245
1285
|
return 1 + maxChildDepth;
|
1246
1286
|
}
|
1247
|
-
exports.getContainerDepth = getContainerDepth;
|
1248
1287
|
function lookUpObjectMember(objectType, memberName, flags = 0 /* MemberAccessFlags.Default */, skipMroClass) {
|
1249
1288
|
if ((0, types_1.isClassInstance)(objectType)) {
|
1250
1289
|
return lookUpClassMember(objectType, memberName, flags, skipMroClass);
|
1251
1290
|
}
|
1252
1291
|
return undefined;
|
1253
1292
|
}
|
1254
|
-
exports.lookUpObjectMember = lookUpObjectMember;
|
1255
1293
|
// Looks up a member in a class using the multiple-inheritance rules
|
1256
1294
|
// defined by Python.
|
1257
1295
|
function lookUpClassMember(classType, memberName, flags = 0 /* MemberAccessFlags.Default */, skipMroClass) {
|
@@ -1275,7 +1313,6 @@ function lookUpClassMember(classType, memberName, flags = 0 /* MemberAccessFlags
|
|
1275
1313
|
const memberItr = getClassMemberIterator(classType, memberName, flags, skipMroClass);
|
1276
1314
|
return (_b = memberItr.next()) === null || _b === void 0 ? void 0 : _b.value;
|
1277
1315
|
}
|
1278
|
-
exports.lookUpClassMember = lookUpClassMember;
|
1279
1316
|
// Iterates members in a class matching memberName using the multiple-inheritance rules.
|
1280
1317
|
// For more details, see this note on method resolution
|
1281
1318
|
// order: https://www.python.org/download/releases/2.3/mro/.
|
@@ -1411,7 +1448,6 @@ function* getClassMemberIterator(classType, memberName, flags = 0 /* MemberAcces
|
|
1411
1448
|
}
|
1412
1449
|
return undefined;
|
1413
1450
|
}
|
1414
|
-
exports.getClassMemberIterator = getClassMemberIterator;
|
1415
1451
|
function* getClassIterator(classType, flags = 0 /* ClassIteratorFlags.Default */, skipMroClass) {
|
1416
1452
|
if ((0, types_1.isClass)(classType)) {
|
1417
1453
|
let foundSkipMroClass = skipMroClass === undefined;
|
@@ -1456,7 +1492,6 @@ function* getClassIterator(classType, flags = 0 /* ClassIteratorFlags.Default */
|
|
1456
1492
|
}
|
1457
1493
|
return undefined;
|
1458
1494
|
}
|
1459
|
-
exports.getClassIterator = getClassIterator;
|
1460
1495
|
function getClassFieldsRecursive(classType) {
|
1461
1496
|
const memberMap = new Map();
|
1462
1497
|
// Evaluate the types of members from the end of the MRO to the beginning.
|
@@ -1486,7 +1521,6 @@ function getClassFieldsRecursive(classType) {
|
|
1486
1521
|
});
|
1487
1522
|
return memberMap;
|
1488
1523
|
}
|
1489
|
-
exports.getClassFieldsRecursive = getClassFieldsRecursive;
|
1490
1524
|
// Combines two lists of type var types, maintaining the combined order
|
1491
1525
|
// but removing any duplicates.
|
1492
1526
|
function addTypeVarsToListIfUnique(list1, list2, typeVarScopeId) {
|
@@ -1499,7 +1533,6 @@ function addTypeVarsToListIfUnique(list1, list2, typeVarScopeId) {
|
|
1499
1533
|
}
|
1500
1534
|
}
|
1501
1535
|
}
|
1502
|
-
exports.addTypeVarsToListIfUnique = addTypeVarsToListIfUnique;
|
1503
1536
|
// Walks the type recursively (in a depth-first manner), finds all
|
1504
1537
|
// type variables that are referenced, and returns an ordered list
|
1505
1538
|
// of unique type variables. For example, if the type is
|
@@ -1560,7 +1593,6 @@ function getTypeVarArgsRecursive(type, recursionCount = 0) {
|
|
1560
1593
|
}
|
1561
1594
|
return [];
|
1562
1595
|
}
|
1563
|
-
exports.getTypeVarArgsRecursive = getTypeVarArgsRecursive;
|
1564
1596
|
// Creates a specialized version of the class, filling in any unspecified
|
1565
1597
|
// type arguments with Unknown.
|
1566
1598
|
function specializeClassType(type) {
|
@@ -1571,66 +1603,6 @@ function specializeClassType(type) {
|
|
1571
1603
|
});
|
1572
1604
|
return applySolvedTypeVars(type, solution);
|
1573
1605
|
}
|
1574
|
-
exports.specializeClassType = specializeClassType;
|
1575
|
-
// Recursively finds all of the type arguments and sets them
|
1576
|
-
// to the specified srcType.
|
1577
|
-
function setTypeArgsRecursive(destType, srcType, constraints, recursionCount = 0) {
|
1578
|
-
if (recursionCount > types_1.maxTypeRecursionCount) {
|
1579
|
-
return;
|
1580
|
-
}
|
1581
|
-
recursionCount++;
|
1582
|
-
if (constraints.isLocked()) {
|
1583
|
-
return;
|
1584
|
-
}
|
1585
|
-
switch (destType.category) {
|
1586
|
-
case 8 /* TypeCategory.Union */:
|
1587
|
-
doForEachSubtype(destType, (subtype) => {
|
1588
|
-
setTypeArgsRecursive(subtype, srcType, constraints, recursionCount);
|
1589
|
-
});
|
1590
|
-
break;
|
1591
|
-
case 6 /* TypeCategory.Class */:
|
1592
|
-
if (destType.priv.typeArgs) {
|
1593
|
-
destType.priv.typeArgs.forEach((typeArg) => {
|
1594
|
-
setTypeArgsRecursive(typeArg, srcType, constraints, recursionCount);
|
1595
|
-
});
|
1596
|
-
}
|
1597
|
-
if (destType.priv.tupleTypeArgs) {
|
1598
|
-
destType.priv.tupleTypeArgs.forEach((typeArg) => {
|
1599
|
-
setTypeArgsRecursive(typeArg.type, srcType, constraints, recursionCount);
|
1600
|
-
});
|
1601
|
-
}
|
1602
|
-
break;
|
1603
|
-
case 4 /* TypeCategory.Function */:
|
1604
|
-
if (destType.priv.specializedTypes) {
|
1605
|
-
destType.priv.specializedTypes.parameterTypes.forEach((paramType) => {
|
1606
|
-
setTypeArgsRecursive(paramType, srcType, constraints, recursionCount);
|
1607
|
-
});
|
1608
|
-
if (destType.priv.specializedTypes.returnType) {
|
1609
|
-
setTypeArgsRecursive(destType.priv.specializedTypes.returnType, srcType, constraints, recursionCount);
|
1610
|
-
}
|
1611
|
-
}
|
1612
|
-
else {
|
1613
|
-
destType.shared.parameters.forEach((_, index) => {
|
1614
|
-
setTypeArgsRecursive(types_1.FunctionType.getParamType(destType, index), srcType, constraints, recursionCount);
|
1615
|
-
});
|
1616
|
-
if (destType.shared.declaredReturnType) {
|
1617
|
-
setTypeArgsRecursive(destType.shared.declaredReturnType, srcType, constraints, recursionCount);
|
1618
|
-
}
|
1619
|
-
}
|
1620
|
-
break;
|
1621
|
-
case 5 /* TypeCategory.OverloadedFunction */:
|
1622
|
-
destType.priv.overloads.forEach((subtype) => {
|
1623
|
-
setTypeArgsRecursive(subtype, srcType, constraints, recursionCount);
|
1624
|
-
});
|
1625
|
-
break;
|
1626
|
-
case 9 /* TypeCategory.TypeVar */:
|
1627
|
-
if (!constraints.getMainConstraintSet().getTypeVar(destType)) {
|
1628
|
-
constraints.setBounds(destType, srcType);
|
1629
|
-
}
|
1630
|
-
break;
|
1631
|
-
}
|
1632
|
-
}
|
1633
|
-
exports.setTypeArgsRecursive = setTypeArgsRecursive;
|
1634
1606
|
// Builds a mapping between type parameters and their specialized
|
1635
1607
|
// types. For example, if the generic type is Dict[_T1, _T2] and the
|
1636
1608
|
// specialized type is Dict[str, int], it returns a map that associates
|
@@ -1641,7 +1613,7 @@ function buildSolutionFromSpecializedClass(classType) {
|
|
1641
1613
|
if (classType.priv.tupleTypeArgs) {
|
1642
1614
|
typeArgs = [
|
1643
1615
|
convertToInstance(specializeTupleClass(classType, classType.priv.tupleTypeArgs, classType.priv.isTypeArgExplicit,
|
1644
|
-
/*
|
1616
|
+
/* isUnpacked */ true)),
|
1645
1617
|
];
|
1646
1618
|
}
|
1647
1619
|
else {
|
@@ -1649,7 +1621,6 @@ function buildSolutionFromSpecializedClass(classType) {
|
|
1649
1621
|
}
|
1650
1622
|
return buildSolution(typeParams, typeArgs);
|
1651
1623
|
}
|
1652
|
-
exports.buildSolutionFromSpecializedClass = buildSolutionFromSpecializedClass;
|
1653
1624
|
function buildSolution(typeParams, typeArgs) {
|
1654
1625
|
const solution = new constraintSolution_1.ConstraintSolution();
|
1655
1626
|
if (!typeArgs) {
|
@@ -1662,7 +1633,6 @@ function buildSolution(typeParams, typeArgs) {
|
|
1662
1633
|
});
|
1663
1634
|
return solution;
|
1664
1635
|
}
|
1665
|
-
exports.buildSolution = buildSolution;
|
1666
1636
|
// Determines the specialized base class type that srcType derives from.
|
1667
1637
|
function specializeForBaseClass(srcType, baseClass) {
|
1668
1638
|
const typeParams = types_1.ClassType.getTypeParams(baseClass);
|
@@ -1676,11 +1646,9 @@ function specializeForBaseClass(srcType, baseClass) {
|
|
1676
1646
|
(0, debug_1.assert)((0, types_1.isInstantiableClass)(specializedType));
|
1677
1647
|
return specializedType;
|
1678
1648
|
}
|
1679
|
-
exports.specializeForBaseClass = specializeForBaseClass;
|
1680
1649
|
function derivesFromStdlibClass(classType, className) {
|
1681
1650
|
return classType.shared.mro.some((mroClass) => (0, types_1.isClass)(mroClass) && types_1.ClassType.isBuiltIn(mroClass, className));
|
1682
1651
|
}
|
1683
|
-
exports.derivesFromStdlibClass = derivesFromStdlibClass;
|
1684
1652
|
// If ignoreUnknown is true, an unknown base class is ignored when
|
1685
1653
|
// checking for derivation. If ignoreUnknown is false, a return value
|
1686
1654
|
// of true is assumed.
|
@@ -1701,7 +1669,6 @@ function derivesFromClassRecursive(classType, baseClassToFind, ignoreUnknown) {
|
|
1701
1669
|
}
|
1702
1670
|
return false;
|
1703
1671
|
}
|
1704
|
-
exports.derivesFromClassRecursive = derivesFromClassRecursive;
|
1705
1672
|
function synthesizeTypeVarForSelfCls(classType, isClsParam) {
|
1706
1673
|
var _a;
|
1707
1674
|
const selfType = types_1.TypeVarType.createInstance(`__type_of_self__`);
|
@@ -1717,7 +1684,6 @@ function synthesizeTypeVarForSelfCls(classType, isClsParam) {
|
|
1717
1684
|
selfType.shared.boundType = types_1.ClassType.cloneAsInstance(boundType);
|
1718
1685
|
return isClsParam ? types_1.TypeVarType.cloneAsInstantiable(selfType) : selfType;
|
1719
1686
|
}
|
1720
|
-
exports.synthesizeTypeVarForSelfCls = synthesizeTypeVarForSelfCls;
|
1721
1687
|
// Returns the declared "return" type (the type returned from a return statement)
|
1722
1688
|
// if it was declared, or undefined otherwise.
|
1723
1689
|
function getDeclaredGeneratorReturnType(functionType) {
|
@@ -1731,7 +1697,6 @@ function getDeclaredGeneratorReturnType(functionType) {
|
|
1731
1697
|
}
|
1732
1698
|
return undefined;
|
1733
1699
|
}
|
1734
|
-
exports.getDeclaredGeneratorReturnType = getDeclaredGeneratorReturnType;
|
1735
1700
|
// If the declared return type is a Generator, Iterable, Iterator or the async
|
1736
1701
|
// counterparts, returns the yield type. If the type is invalid for a generator,
|
1737
1702
|
// returns undefined.
|
@@ -1759,17 +1724,14 @@ function getGeneratorYieldType(declaredReturnType, isAsync) {
|
|
1759
1724
|
});
|
1760
1725
|
return isLegalGeneratorType ? yieldType : undefined;
|
1761
1726
|
}
|
1762
|
-
exports.getGeneratorYieldType = getGeneratorYieldType;
|
1763
1727
|
function isInstantiableMetaclass(type) {
|
1764
1728
|
return ((0, types_1.isInstantiableClass)(type) &&
|
1765
1729
|
type.shared.mro.some((mroClass) => (0, types_1.isClass)(mroClass) && types_1.ClassType.isBuiltIn(mroClass, 'type')));
|
1766
1730
|
}
|
1767
|
-
exports.isInstantiableMetaclass = isInstantiableMetaclass;
|
1768
1731
|
function isMetaclassInstance(type) {
|
1769
1732
|
return ((0, types_1.isClassInstance)(type) &&
|
1770
1733
|
type.shared.mro.some((mroClass) => (0, types_1.isClass)(mroClass) && types_1.ClassType.isBuiltIn(mroClass, 'type')));
|
1771
1734
|
}
|
1772
|
-
exports.isMetaclassInstance = isMetaclassInstance;
|
1773
1735
|
function isEffectivelyInstantiable(type, options, recursionCount = 0) {
|
1774
1736
|
if (recursionCount > types_1.maxTypeRecursionCount) {
|
1775
1737
|
return false;
|
@@ -1793,7 +1755,6 @@ function isEffectivelyInstantiable(type, options, recursionCount = 0) {
|
|
1793
1755
|
}
|
1794
1756
|
return false;
|
1795
1757
|
}
|
1796
|
-
exports.isEffectivelyInstantiable = isEffectivelyInstantiable;
|
1797
1758
|
function convertToInstance(type, includeSubclasses = true) {
|
1798
1759
|
var _a, _b;
|
1799
1760
|
// See if we've already performed this conversion and cached it.
|
@@ -1866,7 +1827,6 @@ function convertToInstance(type, includeSubclasses = true) {
|
|
1866
1827
|
}
|
1867
1828
|
return result;
|
1868
1829
|
}
|
1869
|
-
exports.convertToInstance = convertToInstance;
|
1870
1830
|
function convertToInstantiable(type, includeSubclasses = true) {
|
1871
1831
|
var _a;
|
1872
1832
|
// See if we've already performed this conversion and cached it.
|
@@ -1896,7 +1856,6 @@ function convertToInstantiable(type, includeSubclasses = true) {
|
|
1896
1856
|
}
|
1897
1857
|
return result;
|
1898
1858
|
}
|
1899
|
-
exports.convertToInstantiable = convertToInstantiable;
|
1900
1859
|
function getMembersForClass(classType, symbolTable, includeInstanceVars) {
|
1901
1860
|
classType.shared.mro.forEach((mroClass) => {
|
1902
1861
|
if ((0, types_1.isInstantiableClass)(mroClass)) {
|
@@ -1946,7 +1905,6 @@ function getMembersForClass(classType, symbolTable, includeInstanceVars) {
|
|
1946
1905
|
}
|
1947
1906
|
}
|
1948
1907
|
}
|
1949
|
-
exports.getMembersForClass = getMembersForClass;
|
1950
1908
|
function getMembersForModule(moduleType, symbolTable) {
|
1951
1909
|
// Start with the loader fields. If there are any symbols of the
|
1952
1910
|
// same name defined within the module, they will overwrite the
|
@@ -1960,7 +1918,6 @@ function getMembersForModule(moduleType, symbolTable) {
|
|
1960
1918
|
symbolTable.set(name, symbol);
|
1961
1919
|
});
|
1962
1920
|
}
|
1963
|
-
exports.getMembersForModule = getMembersForModule;
|
1964
1921
|
// Determines if the type contains an Any recursively.
|
1965
1922
|
function containsAnyRecursive(type, includeUnknown = true) {
|
1966
1923
|
class AnyWalker extends typeWalker_1.TypeWalker {
|
@@ -1984,7 +1941,6 @@ function containsAnyRecursive(type, includeUnknown = true) {
|
|
1984
1941
|
walker.walk(type);
|
1985
1942
|
return walker.foundAny;
|
1986
1943
|
}
|
1987
|
-
exports.containsAnyRecursive = containsAnyRecursive;
|
1988
1944
|
// Determines if the type contains an Any or Unknown type. If so,
|
1989
1945
|
// it returns the Any or Unknown type. Unknowns are preferred over
|
1990
1946
|
// Any if both are present. If recurse is true, it will recurse
|
@@ -2025,7 +1981,6 @@ function containsAnyOrUnknown(type, recurse) {
|
|
2025
1981
|
walker.walk(type);
|
2026
1982
|
return walker.anyOrUnknownType;
|
2027
1983
|
}
|
2028
|
-
exports.containsAnyOrUnknown = containsAnyOrUnknown;
|
2029
1984
|
// Determines if any part of the type contains "Unknown", including any type arguments.
|
2030
1985
|
// This function does not use the TypeWalker because it is called very frequently,
|
2031
1986
|
// and allocating a memory walker object for every call significantly increases
|
@@ -2072,8 +2027,8 @@ function isPartlyUnknown(type, recursionCount = 0) {
|
|
2072
2027
|
return false;
|
2073
2028
|
}
|
2074
2029
|
// See if a function has an unknown type.
|
2075
|
-
if ((0, types_1.
|
2076
|
-
return types_1.
|
2030
|
+
if ((0, types_1.isOverloaded)(type)) {
|
2031
|
+
return types_1.OverloadedType.getOverloads(type).some((overload) => {
|
2077
2032
|
return isPartlyUnknown(overload, recursionCount);
|
2078
2033
|
});
|
2079
2034
|
}
|
@@ -2096,7 +2051,6 @@ function isPartlyUnknown(type, recursionCount = 0) {
|
|
2096
2051
|
}
|
2097
2052
|
return false;
|
2098
2053
|
}
|
2099
|
-
exports.isPartlyUnknown = isPartlyUnknown;
|
2100
2054
|
// If the specified type is a generic class with a single type argument
|
2101
2055
|
// that is a union, it "explodes" the class into a union of classes with
|
2102
2056
|
// each element of the union - e.g. Foo[A | B] becomes Foo[A] | Foo[B].
|
@@ -2108,7 +2062,6 @@ function explodeGenericClass(classType) {
|
|
2108
2062
|
return types_1.ClassType.specialize(classType, [subtype]);
|
2109
2063
|
}));
|
2110
2064
|
}
|
2111
|
-
exports.explodeGenericClass = explodeGenericClass;
|
2112
2065
|
// If the type is a union of same-sized tuples, these are combined into
|
2113
2066
|
// a single tuple with that size. Otherwise, returns undefined.
|
2114
2067
|
function combineSameSizedTuples(type, tupleType) {
|
@@ -2158,7 +2111,6 @@ function combineSameSizedTuples(type, tupleType) {
|
|
2158
2111
|
return { type: (0, types_1.combineTypes)(entry), isUnbounded: false };
|
2159
2112
|
})));
|
2160
2113
|
}
|
2161
|
-
exports.combineSameSizedTuples = combineSameSizedTuples;
|
2162
2114
|
function combineTupleTypeArgs(typeArgs) {
|
2163
2115
|
return (0, types_1.combineTypes)(typeArgs.map((t) => {
|
2164
2116
|
if ((0, types_1.isTypeVar)(t.type) && (0, types_1.isUnpackedTypeVarTuple)(t.type)) {
|
@@ -2168,19 +2120,17 @@ function combineTupleTypeArgs(typeArgs) {
|
|
2168
2120
|
return t.type;
|
2169
2121
|
}));
|
2170
2122
|
}
|
2171
|
-
exports.combineTupleTypeArgs = combineTupleTypeArgs;
|
2172
2123
|
// Tuples require special handling for specialization. This method computes
|
2173
2124
|
// the "effective" type argument, which is a union of the variadic type
|
2174
2125
|
// arguments.
|
2175
|
-
function specializeTupleClass(classType, typeArgs, isTypeArgExplicit = true,
|
2126
|
+
function specializeTupleClass(classType, typeArgs, isTypeArgExplicit = true, isUnpacked = false) {
|
2176
2127
|
const clonedClassType = types_1.ClassType.specialize(classType, [combineTupleTypeArgs(typeArgs)], isTypeArgExplicit,
|
2177
2128
|
/* includeSubclasses */ undefined, typeArgs);
|
2178
|
-
if (
|
2129
|
+
if (isUnpacked) {
|
2179
2130
|
clonedClassType.priv.isUnpacked = true;
|
2180
2131
|
}
|
2181
2132
|
return clonedClassType;
|
2182
2133
|
}
|
2183
|
-
exports.specializeTupleClass = specializeTupleClass;
|
2184
2134
|
function _expandUnpackedTypeVarTupleUnion(type) {
|
2185
2135
|
if ((0, types_1.isClassInstance)(type) && isTupleClass(type) && type.priv.tupleTypeArgs && type.priv.isUnpacked) {
|
2186
2136
|
return (0, types_1.combineTypes)(type.priv.tupleTypeArgs.map((t) => t.type));
|
@@ -2203,7 +2153,6 @@ function getGeneratorTypeArgs(returnType) {
|
|
2203
2153
|
}
|
2204
2154
|
return undefined;
|
2205
2155
|
}
|
2206
|
-
exports.getGeneratorTypeArgs = getGeneratorTypeArgs;
|
2207
2156
|
function requiresTypeArgs(classType) {
|
2208
2157
|
if (classType.shared.typeParams.length > 0) {
|
2209
2158
|
const firstTypeParam = classType.shared.typeParams[0];
|
@@ -2241,7 +2190,6 @@ function requiresTypeArgs(classType) {
|
|
2241
2190
|
}
|
2242
2191
|
return false;
|
2243
2192
|
}
|
2244
|
-
exports.requiresTypeArgs = requiresTypeArgs;
|
2245
2193
|
function requiresSpecialization(type, options, recursionCount = 0) {
|
2246
2194
|
var _a;
|
2247
2195
|
if (recursionCount > types_1.maxTypeRecursionCount) {
|
@@ -2262,7 +2210,6 @@ function requiresSpecialization(type, options, recursionCount = 0) {
|
|
2262
2210
|
}
|
2263
2211
|
return result;
|
2264
2212
|
}
|
2265
|
-
exports.requiresSpecialization = requiresSpecialization;
|
2266
2213
|
function _requiresSpecialization(type, options, recursionCount = 0) {
|
2267
2214
|
var _a, _b;
|
2268
2215
|
// If the type is conditioned on a TypeVar, it may need to be specialized.
|
@@ -2303,8 +2250,16 @@ function _requiresSpecialization(type, options, recursionCount = 0) {
|
|
2303
2250
|
}
|
2304
2251
|
return false;
|
2305
2252
|
}
|
2306
|
-
case 5 /* TypeCategory.
|
2307
|
-
|
2253
|
+
case 5 /* TypeCategory.Overloaded */: {
|
2254
|
+
const overloads = types_1.OverloadedType.getOverloads(type);
|
2255
|
+
if (overloads.some((overload) => requiresSpecialization(overload, options, recursionCount))) {
|
2256
|
+
return true;
|
2257
|
+
}
|
2258
|
+
const impl = types_1.OverloadedType.getImplementation(type);
|
2259
|
+
if (impl) {
|
2260
|
+
return requiresSpecialization(impl, options, recursionCount);
|
2261
|
+
}
|
2262
|
+
return false;
|
2308
2263
|
}
|
2309
2264
|
case 8 /* TypeCategory.Union */: {
|
2310
2265
|
return type.priv.subtypes.some((subtype) => requiresSpecialization(subtype, options, recursionCount));
|
@@ -2339,7 +2294,6 @@ function combineVariances(variance1, variance2) {
|
|
2339
2294
|
}
|
2340
2295
|
return variance1;
|
2341
2296
|
}
|
2342
|
-
exports.combineVariances = combineVariances;
|
2343
2297
|
// Determines if the variance of the type argument for a generic class is compatible
|
2344
2298
|
// With the declared variance of the corresponding type parameter.
|
2345
2299
|
function isVarianceOfTypeArgCompatible(type, typeParamVariance) {
|
@@ -2388,7 +2342,6 @@ function isVarianceOfTypeArgCompatible(type, typeParamVariance) {
|
|
2388
2342
|
}
|
2389
2343
|
return true;
|
2390
2344
|
}
|
2391
|
-
exports.isVarianceOfTypeArgCompatible = isVarianceOfTypeArgCompatible;
|
2392
2345
|
// Computes the method resolution ordering for a class whose base classes
|
2393
2346
|
// have already been filled in. The algorithm for computing MRO is described
|
2394
2347
|
// here: https://www.python.org/download/releases/2.3/mro/. It returns true
|
@@ -2518,7 +2471,6 @@ function computeMroLinearization(classType) {
|
|
2518
2471
|
}
|
2519
2472
|
return isMroFound;
|
2520
2473
|
}
|
2521
|
-
exports.computeMroLinearization = computeMroLinearization;
|
2522
2474
|
// Returns zero or more unique module names that point to the place(s)
|
2523
2475
|
// where the type is declared. Unions, for example, can result in more
|
2524
2476
|
// than one result. Type arguments are not included.
|
@@ -2527,7 +2479,6 @@ function getDeclaringModulesForType(type) {
|
|
2527
2479
|
addDeclaringModuleNamesForType(type, moduleList);
|
2528
2480
|
return moduleList;
|
2529
2481
|
}
|
2530
|
-
exports.getDeclaringModulesForType = getDeclaringModulesForType;
|
2531
2482
|
function convertNodeToArg(node) {
|
2532
2483
|
return {
|
2533
2484
|
argCategory: node.d.argCategory,
|
@@ -2535,7 +2486,6 @@ function convertNodeToArg(node) {
|
|
2535
2486
|
valueExpression: node.d.valueExpr,
|
2536
2487
|
};
|
2537
2488
|
}
|
2538
|
-
exports.convertNodeToArg = convertNodeToArg;
|
2539
2489
|
function addDeclaringModuleNamesForType(type, moduleList, recursionCount = 0) {
|
2540
2490
|
if (recursionCount > types_1.maxTypeRecursionCount) {
|
2541
2491
|
return;
|
@@ -2555,10 +2505,15 @@ function addDeclaringModuleNamesForType(type, moduleList, recursionCount = 0) {
|
|
2555
2505
|
addIfUnique(type.shared.moduleName);
|
2556
2506
|
break;
|
2557
2507
|
}
|
2558
|
-
case 5 /* TypeCategory.
|
2559
|
-
|
2508
|
+
case 5 /* TypeCategory.Overloaded */: {
|
2509
|
+
const overloads = types_1.OverloadedType.getOverloads(type);
|
2510
|
+
overloads.forEach((overload) => {
|
2560
2511
|
addDeclaringModuleNamesForType(overload, moduleList, recursionCount);
|
2561
2512
|
});
|
2513
|
+
const impl = types_1.OverloadedType.getImplementation(type);
|
2514
|
+
if (impl) {
|
2515
|
+
addDeclaringModuleNamesForType(impl, moduleList, recursionCount);
|
2516
|
+
}
|
2562
2517
|
break;
|
2563
2518
|
}
|
2564
2519
|
case 8 /* TypeCategory.Union */: {
|
@@ -2599,7 +2554,6 @@ function convertTypeToParamSpecValue(type) {
|
|
2599
2554
|
}
|
2600
2555
|
return types_1.ParamSpecType.getUnknown();
|
2601
2556
|
}
|
2602
|
-
exports.convertTypeToParamSpecValue = convertTypeToParamSpecValue;
|
2603
2557
|
// Converts a FunctionType into a ParamSpec if it consists only of
|
2604
2558
|
// (* args: P.args, ** kwargs: P.kwargs). Otherwise returns the original type.
|
2605
2559
|
function simplifyFunctionToParamSpec(type) {
|
@@ -2620,7 +2574,6 @@ function simplifyFunctionToParamSpec(type) {
|
|
2620
2574
|
}
|
2621
2575
|
return type;
|
2622
2576
|
}
|
2623
|
-
exports.simplifyFunctionToParamSpec = simplifyFunctionToParamSpec;
|
2624
2577
|
// Recursively walks a type and calls a callback for each TypeVar, allowing
|
2625
2578
|
// it to be replaced with something else.
|
2626
2579
|
class TypeVarTransformer {
|
@@ -2746,7 +2699,7 @@ class TypeVarTransformer {
|
|
2746
2699
|
this._pendingFunctionTransformations.pop();
|
2747
2700
|
return result;
|
2748
2701
|
}
|
2749
|
-
if ((0, types_1.
|
2702
|
+
if ((0, types_1.isOverloaded)(type)) {
|
2750
2703
|
// Prevent recursion.
|
2751
2704
|
if (this._pendingFunctionTransformations.some((t) => t === type)) {
|
2752
2705
|
return type;
|
@@ -2754,22 +2707,31 @@ class TypeVarTransformer {
|
|
2754
2707
|
this._pendingFunctionTransformations.push(type);
|
2755
2708
|
let requiresUpdate = false;
|
2756
2709
|
// Specialize each of the functions in the overload.
|
2710
|
+
const overloads = types_1.OverloadedType.getOverloads(type);
|
2757
2711
|
const newOverloads = [];
|
2758
|
-
|
2712
|
+
overloads.forEach((entry) => {
|
2759
2713
|
const replacementType = this.transformTypeVarsInFunctionType(entry, recursionCount);
|
2760
2714
|
if ((0, types_1.isFunction)(replacementType)) {
|
2761
2715
|
newOverloads.push(replacementType);
|
2762
2716
|
}
|
2763
2717
|
else {
|
2764
|
-
(0, collectionUtils_1.appendArray)(newOverloads,
|
2718
|
+
(0, collectionUtils_1.appendArray)(newOverloads, types_1.OverloadedType.getOverloads(replacementType));
|
2765
2719
|
}
|
2766
2720
|
if (replacementType !== entry) {
|
2767
2721
|
requiresUpdate = true;
|
2768
2722
|
}
|
2769
2723
|
});
|
2724
|
+
const impl = types_1.OverloadedType.getImplementation(type);
|
2725
|
+
let newImpl = impl;
|
2726
|
+
if (impl) {
|
2727
|
+
newImpl = this.apply(impl, recursionCount);
|
2728
|
+
if (newImpl !== impl) {
|
2729
|
+
requiresUpdate = true;
|
2730
|
+
}
|
2731
|
+
}
|
2770
2732
|
this._pendingFunctionTransformations.pop();
|
2771
2733
|
// Construct a new overload with the specialized function types.
|
2772
|
-
return requiresUpdate ? types_1.
|
2734
|
+
return requiresUpdate ? types_1.OverloadedType.create(newOverloads, newImpl) : type;
|
2773
2735
|
}
|
2774
2736
|
return type;
|
2775
2737
|
}
|
@@ -3089,7 +3051,7 @@ class UniqueFunctionSignatureTransformer extends TypeVarTransformer {
|
|
3089
3051
|
}
|
3090
3052
|
});
|
3091
3053
|
updatedSourceType = applySolvedTypeVars(sourceType, solution);
|
3092
|
-
(0, debug_1.assert)((0, types_1.isFunction)(updatedSourceType) || (0, types_1.
|
3054
|
+
(0, debug_1.assert)((0, types_1.isFunction)(updatedSourceType) || (0, types_1.isOverloaded)(updatedSourceType));
|
3093
3055
|
}
|
3094
3056
|
}
|
3095
3057
|
this._signatureTracker.addSignature(sourceType, this._expressionOffset);
|
@@ -3333,7 +3295,7 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer {
|
|
3333
3295
|
if (filteredOverloads.length === 1) {
|
3334
3296
|
return filteredOverloads[0];
|
3335
3297
|
}
|
3336
|
-
return types_1.
|
3298
|
+
return types_1.OverloadedType.create(filteredOverloads);
|
3337
3299
|
}
|
3338
3300
|
// Handle the case where we need the default replacement value for a typeVar
|
3339
3301
|
// that has no scope and therefore doesn't have an assigned scopeID. We'll
|