@zzzen/pyright-internal 1.2.0-dev.20240804 → 1.2.0-dev.20240811
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyzer/analysis.js +2 -2
- package/dist/analyzer/analysis.js.map +1 -1
- package/dist/analyzer/analyzerFileInfo.js +1 -2
- 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 +268 -203
- 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 +137 -161
- 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 +37 -26
- 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 +17 -14
- 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 +5 -5
- 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 +6 -7
- 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 +26 -30
- 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 +6 -6
- 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 +2 -3
- 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 +6 -7
- 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 +419 -419
- 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 +10 -14
- package/dist/analyzer/typeUtils.js +166 -215
- 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 +71 -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 -7
- 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.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.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 +2 -2
- 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 +3 -0
- package/dist/localization/localize.js +7 -6
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.en-us.json +2 -1
- 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.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 +2 -2
- package/dist/tests/typeEvaluator6.test.js +17 -9
- package/dist/tests/typeEvaluator6.test.js.map +1 -1
- 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,106 @@
|
|
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.makeTypeVarsBound = makeTypeVarsBound;
|
64
|
+
exports.makeTypeVarsFree = makeTypeVarsFree;
|
65
|
+
exports.applySolvedTypeVars = applySolvedTypeVars;
|
66
|
+
exports.validateTypeVarDefault = validateTypeVarDefault;
|
67
|
+
exports.transformExpectedType = transformExpectedType;
|
68
|
+
exports.getProtocolSymbols = getProtocolSymbols;
|
69
|
+
exports.getProtocolSymbolsRecursive = getProtocolSymbolsRecursive;
|
70
|
+
exports.getContainerDepth = getContainerDepth;
|
71
|
+
exports.lookUpObjectMember = lookUpObjectMember;
|
72
|
+
exports.lookUpClassMember = lookUpClassMember;
|
73
|
+
exports.getClassMemberIterator = getClassMemberIterator;
|
74
|
+
exports.getClassIterator = getClassIterator;
|
75
|
+
exports.getClassFieldsRecursive = getClassFieldsRecursive;
|
76
|
+
exports.addTypeVarsToListIfUnique = addTypeVarsToListIfUnique;
|
77
|
+
exports.getTypeVarArgsRecursive = getTypeVarArgsRecursive;
|
78
|
+
exports.specializeClassType = specializeClassType;
|
79
|
+
exports.buildSolutionFromSpecializedClass = buildSolutionFromSpecializedClass;
|
80
|
+
exports.buildSolution = buildSolution;
|
81
|
+
exports.specializeForBaseClass = specializeForBaseClass;
|
82
|
+
exports.derivesFromStdlibClass = derivesFromStdlibClass;
|
83
|
+
exports.derivesFromClassRecursive = derivesFromClassRecursive;
|
84
|
+
exports.synthesizeTypeVarForSelfCls = synthesizeTypeVarForSelfCls;
|
85
|
+
exports.getDeclaredGeneratorReturnType = getDeclaredGeneratorReturnType;
|
86
|
+
exports.getGeneratorYieldType = getGeneratorYieldType;
|
87
|
+
exports.isInstantiableMetaclass = isInstantiableMetaclass;
|
88
|
+
exports.isMetaclassInstance = isMetaclassInstance;
|
89
|
+
exports.isEffectivelyInstantiable = isEffectivelyInstantiable;
|
90
|
+
exports.convertToInstance = convertToInstance;
|
91
|
+
exports.convertToInstantiable = convertToInstantiable;
|
92
|
+
exports.getMembersForClass = getMembersForClass;
|
93
|
+
exports.getMembersForModule = getMembersForModule;
|
94
|
+
exports.containsAnyRecursive = containsAnyRecursive;
|
95
|
+
exports.containsAnyOrUnknown = containsAnyOrUnknown;
|
96
|
+
exports.isPartlyUnknown = isPartlyUnknown;
|
97
|
+
exports.explodeGenericClass = explodeGenericClass;
|
98
|
+
exports.combineSameSizedTuples = combineSameSizedTuples;
|
99
|
+
exports.combineTupleTypeArgs = combineTupleTypeArgs;
|
100
|
+
exports.specializeTupleClass = specializeTupleClass;
|
101
|
+
exports.getGeneratorTypeArgs = getGeneratorTypeArgs;
|
102
|
+
exports.requiresTypeArgs = requiresTypeArgs;
|
103
|
+
exports.requiresSpecialization = requiresSpecialization;
|
104
|
+
exports.combineVariances = combineVariances;
|
105
|
+
exports.isVarianceOfTypeArgCompatible = isVarianceOfTypeArgCompatible;
|
106
|
+
exports.computeMroLinearization = computeMroLinearization;
|
107
|
+
exports.getDeclaringModulesForType = getDeclaringModulesForType;
|
108
|
+
exports.convertNodeToArg = convertNodeToArg;
|
109
|
+
exports.convertTypeToParamSpecValue = convertTypeToParamSpecValue;
|
110
|
+
exports.simplifyFunctionToParamSpec = simplifyFunctionToParamSpec;
|
14
111
|
const collectionUtils_1 = require("../common/collectionUtils");
|
15
112
|
const debug_1 = require("../common/debug");
|
16
113
|
const constraintSolution_1 = require("./constraintSolution");
|
@@ -79,11 +176,11 @@ var AssignTypeFlags;
|
|
79
176
|
AssignTypeFlags[AssignTypeFlags["Default"] = 0] = "Default";
|
80
177
|
// Require invariance with respect to class matching? Normally
|
81
178
|
// subclasses are allowed.
|
82
|
-
AssignTypeFlags[AssignTypeFlags["
|
179
|
+
AssignTypeFlags[AssignTypeFlags["Invariant"] = 1] = "Invariant";
|
83
180
|
// The caller has swapped the source and dest types because
|
84
181
|
// the types are contravariant. Perform type var matching
|
85
182
|
// on dest type vars rather than source type var.
|
86
|
-
AssignTypeFlags[AssignTypeFlags["
|
183
|
+
AssignTypeFlags[AssignTypeFlags["Contravariant"] = 2] = "Contravariant";
|
87
184
|
// We're comparing type compatibility of two distinct recursive types.
|
88
185
|
// This has the potential of recursing infinitely. This flag allows us
|
89
186
|
// to detect the recursion after the first level of checking.
|
@@ -113,8 +210,9 @@ var AssignTypeFlags;
|
|
113
210
|
AssignTypeFlags[AssignTypeFlags["SkipSelfClsTypeCheck"] = 512] = "SkipSelfClsTypeCheck";
|
114
211
|
// We're initially populating the constraints with an expected type,
|
115
212
|
// so TypeVars should match the specified type exactly rather than
|
116
|
-
// employing narrowing or widening
|
117
|
-
|
213
|
+
// employing narrowing or widening. The variance context determines
|
214
|
+
// whether the upper bound, lower bound, or both are established.
|
215
|
+
AssignTypeFlags[AssignTypeFlags["PopulateExpectedType"] = 2048] = "PopulateExpectedType";
|
118
216
|
// Used with PopulatingExpectedType, this flag indicates that a TypeVar
|
119
217
|
// constraint that is Unknown should be ignored.
|
120
218
|
AssignTypeFlags[AssignTypeFlags["SkipPopulateUnknownExpectedType"] = 4096] = "SkipPopulateUnknownExpectedType";
|
@@ -183,25 +281,20 @@ function isOptionalType(type) {
|
|
183
281
|
}
|
184
282
|
return false;
|
185
283
|
}
|
186
|
-
exports.isOptionalType = isOptionalType;
|
187
284
|
function isNoneInstance(type) {
|
188
285
|
return (0, types_1.isClassInstance)(type) && types_1.ClassType.isBuiltIn(type, 'NoneType');
|
189
286
|
}
|
190
|
-
exports.isNoneInstance = isNoneInstance;
|
191
287
|
function isNoneTypeClass(type) {
|
192
288
|
return (0, types_1.isInstantiableClass)(type) && types_1.ClassType.isBuiltIn(type, 'NoneType');
|
193
289
|
}
|
194
|
-
exports.isNoneTypeClass = isNoneTypeClass;
|
195
290
|
// If the type is a union, remove an "None" type from the union,
|
196
291
|
// returning only the known types.
|
197
292
|
function removeNoneFromUnion(type) {
|
198
293
|
return (0, types_1.removeFromUnion)(type, (t) => isNoneInstance(t));
|
199
294
|
}
|
200
|
-
exports.removeNoneFromUnion = removeNoneFromUnion;
|
201
295
|
function isIncompleteUnknown(type) {
|
202
296
|
return (0, types_1.isUnknown)(type) && type.priv.isIncomplete;
|
203
297
|
}
|
204
|
-
exports.isIncompleteUnknown = isIncompleteUnknown;
|
205
298
|
// Similar to isTypeSame except that type1 is a TypeVar and type2
|
206
299
|
// can be either a TypeVar of the same type or a union that includes
|
207
300
|
// conditional types associated with that bound TypeVar.
|
@@ -232,14 +325,12 @@ function isTypeVarSame(type1, type2) {
|
|
232
325
|
});
|
233
326
|
return isCompatible;
|
234
327
|
}
|
235
|
-
exports.isTypeVarSame = isTypeVarSame;
|
236
328
|
function makeInferenceContext(expectedType, isTypeIncomplete, returnTypeOverride) {
|
237
329
|
if (!expectedType) {
|
238
330
|
return undefined;
|
239
331
|
}
|
240
332
|
return { expectedType, isTypeIncomplete, returnTypeOverride };
|
241
333
|
}
|
242
|
-
exports.makeInferenceContext = makeInferenceContext;
|
243
334
|
// Calls a callback for each subtype and combines the results
|
244
335
|
// into a final type. It performs no memory allocations if the
|
245
336
|
// transformed type is the same as the original.
|
@@ -288,7 +379,6 @@ function mapSubtypes(type, callback, options) {
|
|
288
379
|
}
|
289
380
|
return transformedSubtype;
|
290
381
|
}
|
291
|
-
exports.mapSubtypes = mapSubtypes;
|
292
382
|
// Iterates over each signature in a function or overload, allowing the
|
293
383
|
// caller to replace one or more signatures with new ones.
|
294
384
|
function mapSignatures(type, callback) {
|
@@ -297,7 +387,7 @@ function mapSignatures(type, callback) {
|
|
297
387
|
}
|
298
388
|
const newSignatures = [];
|
299
389
|
let changeMade = false;
|
300
|
-
types_1.
|
390
|
+
types_1.OverloadedType.getOverloads(type).forEach((overload, index) => {
|
301
391
|
const newOverload = callback(overload);
|
302
392
|
if (newOverload !== overload) {
|
303
393
|
changeMade = true;
|
@@ -310,12 +400,12 @@ function mapSignatures(type, callback) {
|
|
310
400
|
return undefined;
|
311
401
|
}
|
312
402
|
// Add the unmodified implementation if it's present.
|
313
|
-
const implementation = types_1.
|
314
|
-
|
315
|
-
|
403
|
+
const implementation = types_1.OverloadedType.getImplementation(type);
|
404
|
+
let newImplementation = implementation;
|
405
|
+
if (implementation && (0, types_1.isFunction)(implementation)) {
|
406
|
+
newImplementation = callback(implementation);
|
316
407
|
if (newImplementation) {
|
317
408
|
changeMade = true;
|
318
|
-
newSignatures.push(newImplementation);
|
319
409
|
}
|
320
410
|
}
|
321
411
|
if (!changeMade) {
|
@@ -324,9 +414,8 @@ function mapSignatures(type, callback) {
|
|
324
414
|
if (newSignatures.length === 1) {
|
325
415
|
return newSignatures[0];
|
326
416
|
}
|
327
|
-
return types_1.
|
417
|
+
return types_1.OverloadedType.create(newSignatures, newImplementation);
|
328
418
|
}
|
329
|
-
exports.mapSignatures = mapSignatures;
|
330
419
|
// The code flow engine uses a special form of the UnknownType (with the
|
331
420
|
// isIncomplete flag set) to distinguish between an unknown that was generated
|
332
421
|
// in a loop because it was temporarily incomplete versus an unknown that is
|
@@ -380,14 +469,12 @@ function cleanIncompleteUnknown(type, recursionCount = 0) {
|
|
380
469
|
// If we eliminated everything, don't return a Never.
|
381
470
|
return (0, types_1.isNever)(result) ? type : result;
|
382
471
|
}
|
383
|
-
exports.cleanIncompleteUnknown = cleanIncompleteUnknown;
|
384
472
|
// Sorts types into a deterministic order.
|
385
473
|
function sortTypes(types) {
|
386
474
|
return types.slice(0).sort((a, b) => {
|
387
475
|
return compareTypes(a, b);
|
388
476
|
});
|
389
477
|
}
|
390
|
-
exports.sortTypes = sortTypes;
|
391
478
|
function compareTypes(a, b, recursionCount = 0) {
|
392
479
|
var _a, _b;
|
393
480
|
if (recursionCount > types_1.maxTypeRecursionCount) {
|
@@ -437,15 +524,17 @@ function compareTypes(a, b, recursionCount = 0) {
|
|
437
524
|
}
|
438
525
|
return 0;
|
439
526
|
}
|
440
|
-
case 5 /* TypeCategory.
|
527
|
+
case 5 /* TypeCategory.Overloaded */: {
|
441
528
|
const bOver = b;
|
442
|
-
const
|
443
|
-
const
|
529
|
+
const aOverloads = types_1.OverloadedType.getOverloads(a);
|
530
|
+
const bOverloads = types_1.OverloadedType.getOverloads(bOver);
|
531
|
+
const aOverloadCount = aOverloads.length;
|
532
|
+
const bOverloadCount = bOverloads.length;
|
444
533
|
if (aOverloadCount !== bOverloadCount) {
|
445
534
|
return bOverloadCount - aOverloadCount;
|
446
535
|
}
|
447
536
|
for (let i = 0; i < aOverloadCount; i++) {
|
448
|
-
const typeComparison = compareTypes(
|
537
|
+
const typeComparison = compareTypes(aOverloads[i], bOverloads[i]);
|
449
538
|
if (typeComparison !== 0) {
|
450
539
|
return typeComparison;
|
451
540
|
}
|
@@ -537,7 +626,6 @@ function doForEachSubtype(type, callback, sortSubtypes = false) {
|
|
537
626
|
callback(type, 0, [type]);
|
538
627
|
}
|
539
628
|
}
|
540
|
-
exports.doForEachSubtype = doForEachSubtype;
|
541
629
|
function someSubtypes(type, callback) {
|
542
630
|
if ((0, types_1.isUnion)(type)) {
|
543
631
|
return type.priv.subtypes.some((subtype) => {
|
@@ -548,7 +636,6 @@ function someSubtypes(type, callback) {
|
|
548
636
|
return callback(type);
|
549
637
|
}
|
550
638
|
}
|
551
|
-
exports.someSubtypes = someSubtypes;
|
552
639
|
function allSubtypes(type, callback) {
|
553
640
|
if ((0, types_1.isUnion)(type)) {
|
554
641
|
return type.priv.subtypes.every((subtype) => {
|
@@ -559,18 +646,16 @@ function allSubtypes(type, callback) {
|
|
559
646
|
return callback(type);
|
560
647
|
}
|
561
648
|
}
|
562
|
-
exports.allSubtypes = allSubtypes;
|
563
649
|
function doForEachSignature(type, callback) {
|
564
650
|
if ((0, types_1.isFunction)(type)) {
|
565
651
|
callback(type, 0);
|
566
652
|
}
|
567
653
|
else {
|
568
|
-
types_1.
|
654
|
+
types_1.OverloadedType.getOverloads(type).forEach((overload, index) => {
|
569
655
|
callback(overload, index);
|
570
656
|
});
|
571
657
|
}
|
572
658
|
}
|
573
|
-
exports.doForEachSignature = doForEachSignature;
|
574
659
|
// Determines if all of the types in the array are the same.
|
575
660
|
function areTypesSame(types, options) {
|
576
661
|
if (types.length < 2) {
|
@@ -583,7 +668,6 @@ function areTypesSame(types, options) {
|
|
583
668
|
}
|
584
669
|
return true;
|
585
670
|
}
|
586
|
-
exports.areTypesSame = areTypesSame;
|
587
671
|
// If either type is "Unknown" (versus Any), propagate the Unknown. Preserve
|
588
672
|
// the incomplete flag on the unknown if present. The caller should verify that
|
589
673
|
// one or the other type is Unknown or Any.
|
@@ -601,7 +685,6 @@ function preserveUnknown(type1, type2) {
|
|
601
685
|
return types_1.AnyType.create();
|
602
686
|
}
|
603
687
|
}
|
604
|
-
exports.preserveUnknown = preserveUnknown;
|
605
688
|
// Determines whether the specified type is a type that can be
|
606
689
|
// combined with other types for a union.
|
607
690
|
function isUnionableType(subtypes) {
|
@@ -615,7 +698,6 @@ function isUnionableType(subtypes) {
|
|
615
698
|
// be definitively instantiable (not an instance).
|
616
699
|
return (typeFlags & 1 /* TypeFlags.Instantiable */) !== 0 && (typeFlags & 2 /* TypeFlags.Instance */) === 0;
|
617
700
|
}
|
618
|
-
exports.isUnionableType = isUnionableType;
|
619
701
|
function derivesFromAnyOrUnknown(type) {
|
620
702
|
let anyOrUnknown = false;
|
621
703
|
doForEachSubtype(type, (subtype) => {
|
@@ -635,7 +717,6 @@ function derivesFromAnyOrUnknown(type) {
|
|
635
717
|
});
|
636
718
|
return anyOrUnknown;
|
637
719
|
}
|
638
|
-
exports.derivesFromAnyOrUnknown = derivesFromAnyOrUnknown;
|
639
720
|
function getFullNameOfType(type) {
|
640
721
|
var _a, _b;
|
641
722
|
if ((_b = (_a = type.props) === null || _a === void 0 ? void 0 : _a.typeAliasInfo) === null || _b === void 0 ? void 0 : _b.fullName) {
|
@@ -651,12 +732,19 @@ function getFullNameOfType(type) {
|
|
651
732
|
return type.shared.fullName;
|
652
733
|
case 7 /* TypeCategory.Module */:
|
653
734
|
return type.priv.moduleName;
|
654
|
-
case 5 /* TypeCategory.
|
655
|
-
|
735
|
+
case 5 /* TypeCategory.Overloaded */: {
|
736
|
+
const overloads = types_1.OverloadedType.getOverloads(type);
|
737
|
+
if (overloads.length > 0) {
|
738
|
+
return overloads[0].shared.fullName;
|
739
|
+
}
|
740
|
+
const impl = types_1.OverloadedType.getImplementation(type);
|
741
|
+
if (impl && (0, types_1.isFunction)(impl)) {
|
742
|
+
return impl.shared.fullName;
|
743
|
+
}
|
744
|
+
}
|
656
745
|
}
|
657
746
|
return undefined;
|
658
747
|
}
|
659
|
-
exports.getFullNameOfType = getFullNameOfType;
|
660
748
|
function addConditionToType(type, condition, skipSelfCondition = false) {
|
661
749
|
var _a, _b;
|
662
750
|
if (!condition) {
|
@@ -678,15 +766,14 @@ function addConditionToType(type, condition, skipSelfCondition = false) {
|
|
678
766
|
return type;
|
679
767
|
case 4 /* TypeCategory.Function */:
|
680
768
|
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.
|
769
|
+
case 5 /* TypeCategory.Overloaded */:
|
770
|
+
return types_1.OverloadedType.create(types_1.OverloadedType.getOverloads(type).map((t) => addConditionToType(t, condition)));
|
683
771
|
case 6 /* TypeCategory.Class */:
|
684
772
|
return types_1.TypeBase.cloneForCondition(type, types_1.TypeCondition.combine((_b = type.props) === null || _b === void 0 ? void 0 : _b.condition, condition));
|
685
773
|
case 8 /* TypeCategory.Union */:
|
686
774
|
return (0, types_1.combineTypes)(type.priv.subtypes.map((t) => addConditionToType(t, condition)));
|
687
775
|
}
|
688
776
|
}
|
689
|
-
exports.addConditionToType = addConditionToType;
|
690
777
|
function getTypeCondition(type) {
|
691
778
|
var _a;
|
692
779
|
switch (type.category) {
|
@@ -696,7 +783,7 @@ function getTypeCondition(type) {
|
|
696
783
|
case 3 /* TypeCategory.Never */:
|
697
784
|
case 7 /* TypeCategory.Module */:
|
698
785
|
case 9 /* TypeCategory.TypeVar */:
|
699
|
-
case 5 /* TypeCategory.
|
786
|
+
case 5 /* TypeCategory.Overloaded */:
|
700
787
|
case 8 /* TypeCategory.Union */:
|
701
788
|
return undefined;
|
702
789
|
case 6 /* TypeCategory.Class */:
|
@@ -704,13 +791,11 @@ function getTypeCondition(type) {
|
|
704
791
|
return (_a = type.props) === null || _a === void 0 ? void 0 : _a.condition;
|
705
792
|
}
|
706
793
|
}
|
707
|
-
exports.getTypeCondition = getTypeCondition;
|
708
794
|
// Indicates whether the specified type is a recursive type alias
|
709
795
|
// placeholder that has not yet been resolved.
|
710
796
|
function isTypeAliasPlaceholder(type) {
|
711
797
|
return (0, types_1.isTypeVar)(type) && types_1.TypeVarType.isTypeAliasPlaceholder(type);
|
712
798
|
}
|
713
|
-
exports.isTypeAliasPlaceholder = isTypeAliasPlaceholder;
|
714
799
|
// Determines whether the type alias placeholder is used directly
|
715
800
|
// within the specified type. It's OK if it's used indirectly as
|
716
801
|
// a type argument.
|
@@ -729,7 +814,6 @@ function isTypeAliasRecursive(typeAliasPlaceholder, type) {
|
|
729
814
|
return ((0, types_1.findSubtype)(type, (subtype) => (0, types_1.isTypeVar)(subtype) && subtype.shared === typeAliasPlaceholder.shared) !==
|
730
815
|
undefined);
|
731
816
|
}
|
732
|
-
exports.isTypeAliasRecursive = isTypeAliasRecursive;
|
733
817
|
function transformPossibleRecursiveTypeAlias(type) {
|
734
818
|
var _a, _b;
|
735
819
|
if (type) {
|
@@ -755,7 +839,6 @@ function transformPossibleRecursiveTypeAlias(type) {
|
|
755
839
|
}
|
756
840
|
return type;
|
757
841
|
}
|
758
|
-
exports.transformPossibleRecursiveTypeAlias = transformPossibleRecursiveTypeAlias;
|
759
842
|
function getTypeVarScopeId(type) {
|
760
843
|
if ((0, types_1.isClass)(type)) {
|
761
844
|
return type.shared.typeVarScopeId;
|
@@ -768,7 +851,6 @@ function getTypeVarScopeId(type) {
|
|
768
851
|
}
|
769
852
|
return undefined;
|
770
853
|
}
|
771
|
-
exports.getTypeVarScopeId = getTypeVarScopeId;
|
772
854
|
// This is similar to getTypeVarScopeId except that it includes
|
773
855
|
// the secondary scope IDs for functions.
|
774
856
|
function getTypeVarScopeIds(type) {
|
@@ -784,7 +866,6 @@ function getTypeVarScopeIds(type) {
|
|
784
866
|
}
|
785
867
|
return scopeIds;
|
786
868
|
}
|
787
|
-
exports.getTypeVarScopeIds = getTypeVarScopeIds;
|
788
869
|
// If the class type is generic and does not already have type arguments
|
789
870
|
// specified, specialize it with default type arguments (Unknown or the
|
790
871
|
// default type if provided).
|
@@ -796,7 +877,6 @@ function specializeWithDefaultTypeArgs(type) {
|
|
796
877
|
/* isTypeArgExplicit */ false,
|
797
878
|
/* includeSubclasses */ type.priv.includeSubclasses);
|
798
879
|
}
|
799
|
-
exports.specializeWithDefaultTypeArgs = specializeWithDefaultTypeArgs;
|
800
880
|
// Specializes the class with "Unknown" type args (or the equivalent for ParamSpecs
|
801
881
|
// or TypeVarTuples).
|
802
882
|
function specializeWithUnknownTypeArgs(type, tupleClassType) {
|
@@ -811,7 +891,6 @@ function specializeWithUnknownTypeArgs(type, tupleClassType) {
|
|
811
891
|
/* isTypeArgExplicit */ false,
|
812
892
|
/* includeSubclasses */ type.priv.includeSubclasses);
|
813
893
|
}
|
814
|
-
exports.specializeWithUnknownTypeArgs = specializeWithUnknownTypeArgs;
|
815
894
|
// Returns "Unknown" for simple TypeVars or the equivalent for a ParamSpec.
|
816
895
|
function getUnknownForTypeVar(typeVar, tupleClassType) {
|
817
896
|
if ((0, types_1.isParamSpec)(typeVar)) {
|
@@ -822,14 +901,12 @@ function getUnknownForTypeVar(typeVar, tupleClassType) {
|
|
822
901
|
}
|
823
902
|
return types_1.UnknownType.create();
|
824
903
|
}
|
825
|
-
exports.getUnknownForTypeVar = getUnknownForTypeVar;
|
826
904
|
function getUnknownForTypeVarTuple(tupleClassType) {
|
827
905
|
(0, debug_1.assert)((0, types_1.isInstantiableClass)(tupleClassType) && types_1.ClassType.isBuiltIn(tupleClassType, 'tuple'));
|
828
906
|
return types_1.ClassType.cloneAsInstance(specializeTupleClass(tupleClassType, [{ type: types_1.UnknownType.create(), isUnbounded: true }],
|
829
907
|
/* isTypeArgExplicit */ true,
|
830
908
|
/* isUnpackedTuple */ true));
|
831
909
|
}
|
832
|
-
exports.getUnknownForTypeVarTuple = getUnknownForTypeVarTuple;
|
833
910
|
// Returns the equivalent of "Callable[..., Unknown]".
|
834
911
|
function getUnknownTypeForCallable() {
|
835
912
|
const newFunction = types_1.FunctionType.createSynthesizedInstance('', 32768 /* FunctionTypeFlags.GradualCallableForm */);
|
@@ -837,7 +914,6 @@ function getUnknownTypeForCallable() {
|
|
837
914
|
newFunction.shared.declaredReturnType = types_1.UnknownType.create();
|
838
915
|
return newFunction;
|
839
916
|
}
|
840
|
-
exports.getUnknownTypeForCallable = getUnknownTypeForCallable;
|
841
917
|
// If the class is generic and not already specialized, this function
|
842
918
|
// "self specializes" the class, filling in its own type parameters
|
843
919
|
// as type arguments.
|
@@ -853,7 +929,6 @@ function selfSpecializeClass(type, options) {
|
|
853
929
|
});
|
854
930
|
return types_1.ClassType.specialize(type, typeParams);
|
855
931
|
}
|
856
|
-
exports.selfSpecializeClass = selfSpecializeClass;
|
857
932
|
// Determines whether the type derives from tuple. If so, it returns
|
858
933
|
// the specialized tuple type.
|
859
934
|
function getSpecializedTupleType(type) {
|
@@ -879,11 +954,9 @@ function getSpecializedTupleType(type) {
|
|
879
954
|
const solution = buildSolutionFromSpecializedClass(classType);
|
880
955
|
return applySolvedTypeVars(tupleClass, solution);
|
881
956
|
}
|
882
|
-
exports.getSpecializedTupleType = getSpecializedTupleType;
|
883
957
|
function isLiteralType(type) {
|
884
958
|
return types_1.TypeBase.isInstance(type) && type.priv.literalValue !== undefined;
|
885
959
|
}
|
886
|
-
exports.isLiteralType = isLiteralType;
|
887
960
|
function isLiteralTypeOrUnion(type, allowNone = false) {
|
888
961
|
if ((0, types_1.isClassInstance)(type)) {
|
889
962
|
if (allowNone && isNoneInstance(type)) {
|
@@ -904,7 +977,6 @@ function isLiteralTypeOrUnion(type, allowNone = false) {
|
|
904
977
|
}
|
905
978
|
return false;
|
906
979
|
}
|
907
|
-
exports.isLiteralTypeOrUnion = isLiteralTypeOrUnion;
|
908
980
|
function containsLiteralType(type, includeTypeArgs = false) {
|
909
981
|
class ContainsLiteralTypeWalker extends typeWalker_1.TypeWalker {
|
910
982
|
constructor(_includeTypeArgs) {
|
@@ -928,7 +1000,6 @@ function containsLiteralType(type, includeTypeArgs = false) {
|
|
928
1000
|
walker.walk(type);
|
929
1001
|
return walker.foundLiteral;
|
930
1002
|
}
|
931
|
-
exports.containsLiteralType = containsLiteralType;
|
932
1003
|
// If all of the subtypes are literals with the same built-in class (e.g.
|
933
1004
|
// all 'int' or all 'str'), this function returns the name of that type. If
|
934
1005
|
// some of the subtypes are not literals or the literal classes don't match,
|
@@ -956,24 +1027,20 @@ function getLiteralTypeClassName(type) {
|
|
956
1027
|
}
|
957
1028
|
return undefined;
|
958
1029
|
}
|
959
|
-
exports.getLiteralTypeClassName = getLiteralTypeClassName;
|
960
1030
|
function getUnionSubtypeCount(type) {
|
961
1031
|
if ((0, types_1.isUnion)(type)) {
|
962
1032
|
return type.priv.subtypes.length;
|
963
1033
|
}
|
964
1034
|
return 1;
|
965
1035
|
}
|
966
|
-
exports.getUnionSubtypeCount = getUnionSubtypeCount;
|
967
1036
|
function isEllipsisType(type) {
|
968
1037
|
return (0, types_1.isAny)(type) && type.priv.isEllipsis;
|
969
1038
|
}
|
970
|
-
exports.isEllipsisType = isEllipsisType;
|
971
1039
|
function isProperty(type) {
|
972
1040
|
return (0, types_1.isClassInstance)(type) && types_1.ClassType.isPropertyClass(type);
|
973
1041
|
}
|
974
|
-
exports.isProperty = isProperty;
|
975
1042
|
function isCallableType(type) {
|
976
|
-
if ((0, types_1.isFunction)(type) || (0, types_1.
|
1043
|
+
if ((0, types_1.isFunction)(type) || (0, types_1.isOverloaded)(type) || (0, types_1.isAnyOrUnknown)(type)) {
|
977
1044
|
return true;
|
978
1045
|
}
|
979
1046
|
if (isEffectivelyInstantiable(type)) {
|
@@ -991,14 +1058,12 @@ function isCallableType(type) {
|
|
991
1058
|
}
|
992
1059
|
return false;
|
993
1060
|
}
|
994
|
-
exports.isCallableType = isCallableType;
|
995
1061
|
function isDescriptorInstance(type, requireSetter = false) {
|
996
1062
|
if ((0, types_1.isUnion)(type)) {
|
997
1063
|
return type.priv.subtypes.every((subtype) => isMaybeDescriptorInstance(subtype, requireSetter));
|
998
1064
|
}
|
999
1065
|
return isMaybeDescriptorInstance(type, requireSetter);
|
1000
1066
|
}
|
1001
|
-
exports.isDescriptorInstance = isDescriptorInstance;
|
1002
1067
|
function isMaybeDescriptorInstance(type, requireSetter = false) {
|
1003
1068
|
if ((0, types_1.isUnion)(type)) {
|
1004
1069
|
return type.priv.subtypes.some((subtype) => isMaybeDescriptorInstance(subtype, requireSetter));
|
@@ -1014,7 +1079,6 @@ function isMaybeDescriptorInstance(type, requireSetter = false) {
|
|
1014
1079
|
}
|
1015
1080
|
return true;
|
1016
1081
|
}
|
1017
|
-
exports.isMaybeDescriptorInstance = isMaybeDescriptorInstance;
|
1018
1082
|
function isTupleGradualForm(type) {
|
1019
1083
|
return ((0, types_1.isClassInstance)(type) &&
|
1020
1084
|
isTupleClass(type) &&
|
@@ -1023,11 +1087,9 @@ function isTupleGradualForm(type) {
|
|
1023
1087
|
(0, types_1.isAnyOrUnknown)(type.priv.tupleTypeArgs[0].type) &&
|
1024
1088
|
type.priv.tupleTypeArgs[0].isUnbounded);
|
1025
1089
|
}
|
1026
|
-
exports.isTupleGradualForm = isTupleGradualForm;
|
1027
1090
|
function isTupleClass(type) {
|
1028
1091
|
return types_1.ClassType.isBuiltIn(type, 'tuple');
|
1029
1092
|
}
|
1030
|
-
exports.isTupleClass = isTupleClass;
|
1031
1093
|
// Indicates whether the type is a tuple class of
|
1032
1094
|
// the form tuple[x, ...] where the number of elements
|
1033
1095
|
// in the tuple is unknown.
|
@@ -1035,7 +1097,6 @@ function isUnboundedTupleClass(type) {
|
|
1035
1097
|
var _a;
|
1036
1098
|
return (_a = type.priv.tupleTypeArgs) === null || _a === void 0 ? void 0 : _a.some((t) => t.isUnbounded || (0, types_1.isUnpackedTypeVarTuple)(t.type));
|
1037
1099
|
}
|
1038
|
-
exports.isUnboundedTupleClass = isUnboundedTupleClass;
|
1039
1100
|
// Indicates whether the specified index is within range and its type is unambiguous
|
1040
1101
|
// in that it doesn't involve any element ranges that are of indeterminate length.
|
1041
1102
|
function isTupleIndexUnambiguous(type, index) {
|
@@ -1051,7 +1112,6 @@ function isTupleIndexUnambiguous(type, index) {
|
|
1051
1112
|
const upperIndexLimit = unboundedIndex < 0 ? type.priv.tupleTypeArgs.length : unboundedIndex;
|
1052
1113
|
return index < upperIndexLimit;
|
1053
1114
|
}
|
1054
|
-
exports.isTupleIndexUnambiguous = isTupleIndexUnambiguous;
|
1055
1115
|
// Partially specializes a type within the context of a specified
|
1056
1116
|
// (presumably specialized) class. Optionally specializes the `Self`
|
1057
1117
|
// type variables, replacing them with selfClass.
|
@@ -1088,7 +1148,6 @@ function partiallySpecializeType(type, contextClassType, typeClassType, selfClas
|
|
1088
1148
|
}
|
1089
1149
|
return result;
|
1090
1150
|
}
|
1091
|
-
exports.partiallySpecializeType = partiallySpecializeType;
|
1092
1151
|
function addSolutionForSelfType(solution, contextClassType, selfClass) {
|
1093
1152
|
const synthesizedSelfTypeVar = synthesizeTypeVarForSelfCls(contextClassType, /* isClsParam */ false);
|
1094
1153
|
const selfInstance = convertToInstance(selfClass);
|
@@ -1104,24 +1163,20 @@ function addSolutionForSelfType(solution, contextClassType, selfClass) {
|
|
1104
1163
|
});
|
1105
1164
|
solution.setType(synthesizedSelfTypeVar, selfWithoutLiteral);
|
1106
1165
|
}
|
1107
|
-
exports.addSolutionForSelfType = addSolutionForSelfType;
|
1108
1166
|
// Looks for duplicate function types within the type and ensures that
|
1109
1167
|
// if they are generic, they have unique type variables.
|
1110
1168
|
function ensureSignaturesAreUnique(type, signatureTracker, expressionOffset) {
|
1111
1169
|
const transformer = new UniqueFunctionSignatureTransformer(signatureTracker, expressionOffset);
|
1112
1170
|
return transformer.apply(type, 0);
|
1113
1171
|
}
|
1114
|
-
exports.ensureSignaturesAreUnique = ensureSignaturesAreUnique;
|
1115
1172
|
function makeTypeVarsBound(type, scopeIds) {
|
1116
1173
|
const transformer = new BoundTypeVarTransform(scopeIds);
|
1117
1174
|
return transformer.apply(type, 0);
|
1118
1175
|
}
|
1119
|
-
exports.makeTypeVarsBound = makeTypeVarsBound;
|
1120
1176
|
function makeTypeVarsFree(type, scopeIds) {
|
1121
1177
|
const transformer = new FreeTypeVarTransform(scopeIds);
|
1122
1178
|
return transformer.apply(type, 0);
|
1123
1179
|
}
|
1124
|
-
exports.makeTypeVarsFree = makeTypeVarsFree;
|
1125
1180
|
// Specializes a (potentially generic) type by substituting
|
1126
1181
|
// type variables from a type var map.
|
1127
1182
|
function applySolvedTypeVars(type, solution, options = {}) {
|
@@ -1132,28 +1187,6 @@ function applySolvedTypeVars(type, solution, options = {}) {
|
|
1132
1187
|
const transformer = new ApplySolvedTypeVarsTransformer(solution, options);
|
1133
1188
|
return transformer.apply(type, 0);
|
1134
1189
|
}
|
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
1190
|
// Validates that a default type associated with a TypeVar does not refer to
|
1158
1191
|
// other TypeVars or ParamSpecs that are out of scope.
|
1159
1192
|
function validateTypeVarDefault(typeVar, liveTypeParams, invalidTypeVars) {
|
@@ -1164,7 +1197,6 @@ function validateTypeVarDefault(typeVar, liveTypeParams, invalidTypeVars) {
|
|
1164
1197
|
validator.apply(typeVar.shared.defaultType, 0);
|
1165
1198
|
}
|
1166
1199
|
}
|
1167
|
-
exports.validateTypeVarDefault = validateTypeVarDefault;
|
1168
1200
|
// During bidirectional type inference for constructors, an "expected type"
|
1169
1201
|
// is used to prepopulate the type var map. This is problematic when the
|
1170
1202
|
// expected type uses TypeVars that are not part of the context of the
|
@@ -1174,7 +1206,6 @@ function transformExpectedType(expectedType, liveTypeVarScopes, usageOffset) {
|
|
1174
1206
|
const transformer = new ExpectedTypeTransformer(liveTypeVarScopes, usageOffset);
|
1175
1207
|
return transformer.apply(expectedType, 0);
|
1176
1208
|
}
|
1177
|
-
exports.transformExpectedType = transformExpectedType;
|
1178
1209
|
// Given a protocol class (or abstract class), this function returns
|
1179
1210
|
// a set of all the symbols (indexed by symbol name) that are part of
|
1180
1211
|
// that protocol and its protocol parent classes. If a same-named symbol
|
@@ -1186,7 +1217,6 @@ function getProtocolSymbols(classType) {
|
|
1186
1217
|
}
|
1187
1218
|
return symbolMap;
|
1188
1219
|
}
|
1189
|
-
exports.getProtocolSymbols = getProtocolSymbols;
|
1190
1220
|
function getProtocolSymbolsRecursive(classType, symbolMap, classFlags = 512 /* ClassTypeFlags.ProtocolClass */, recursionCount = 0) {
|
1191
1221
|
if (recursionCount > types_1.maxTypeRecursionCount) {
|
1192
1222
|
return;
|
@@ -1211,7 +1241,6 @@ function getProtocolSymbolsRecursive(classType, symbolMap, classFlags = 512 /* C
|
|
1211
1241
|
}
|
1212
1242
|
});
|
1213
1243
|
}
|
1214
|
-
exports.getProtocolSymbolsRecursive = getProtocolSymbolsRecursive;
|
1215
1244
|
// Determines the maximum depth of a tuple, list, set or dictionary.
|
1216
1245
|
// For example, if the type is tuple[tuple[tuple[int]]], its depth would be 3.
|
1217
1246
|
function getContainerDepth(type, recursionCount = 0) {
|
@@ -1244,14 +1273,12 @@ function getContainerDepth(type, recursionCount = 0) {
|
|
1244
1273
|
}
|
1245
1274
|
return 1 + maxChildDepth;
|
1246
1275
|
}
|
1247
|
-
exports.getContainerDepth = getContainerDepth;
|
1248
1276
|
function lookUpObjectMember(objectType, memberName, flags = 0 /* MemberAccessFlags.Default */, skipMroClass) {
|
1249
1277
|
if ((0, types_1.isClassInstance)(objectType)) {
|
1250
1278
|
return lookUpClassMember(objectType, memberName, flags, skipMroClass);
|
1251
1279
|
}
|
1252
1280
|
return undefined;
|
1253
1281
|
}
|
1254
|
-
exports.lookUpObjectMember = lookUpObjectMember;
|
1255
1282
|
// Looks up a member in a class using the multiple-inheritance rules
|
1256
1283
|
// defined by Python.
|
1257
1284
|
function lookUpClassMember(classType, memberName, flags = 0 /* MemberAccessFlags.Default */, skipMroClass) {
|
@@ -1275,7 +1302,6 @@ function lookUpClassMember(classType, memberName, flags = 0 /* MemberAccessFlags
|
|
1275
1302
|
const memberItr = getClassMemberIterator(classType, memberName, flags, skipMroClass);
|
1276
1303
|
return (_b = memberItr.next()) === null || _b === void 0 ? void 0 : _b.value;
|
1277
1304
|
}
|
1278
|
-
exports.lookUpClassMember = lookUpClassMember;
|
1279
1305
|
// Iterates members in a class matching memberName using the multiple-inheritance rules.
|
1280
1306
|
// For more details, see this note on method resolution
|
1281
1307
|
// order: https://www.python.org/download/releases/2.3/mro/.
|
@@ -1411,7 +1437,6 @@ function* getClassMemberIterator(classType, memberName, flags = 0 /* MemberAcces
|
|
1411
1437
|
}
|
1412
1438
|
return undefined;
|
1413
1439
|
}
|
1414
|
-
exports.getClassMemberIterator = getClassMemberIterator;
|
1415
1440
|
function* getClassIterator(classType, flags = 0 /* ClassIteratorFlags.Default */, skipMroClass) {
|
1416
1441
|
if ((0, types_1.isClass)(classType)) {
|
1417
1442
|
let foundSkipMroClass = skipMroClass === undefined;
|
@@ -1456,7 +1481,6 @@ function* getClassIterator(classType, flags = 0 /* ClassIteratorFlags.Default */
|
|
1456
1481
|
}
|
1457
1482
|
return undefined;
|
1458
1483
|
}
|
1459
|
-
exports.getClassIterator = getClassIterator;
|
1460
1484
|
function getClassFieldsRecursive(classType) {
|
1461
1485
|
const memberMap = new Map();
|
1462
1486
|
// Evaluate the types of members from the end of the MRO to the beginning.
|
@@ -1486,7 +1510,6 @@ function getClassFieldsRecursive(classType) {
|
|
1486
1510
|
});
|
1487
1511
|
return memberMap;
|
1488
1512
|
}
|
1489
|
-
exports.getClassFieldsRecursive = getClassFieldsRecursive;
|
1490
1513
|
// Combines two lists of type var types, maintaining the combined order
|
1491
1514
|
// but removing any duplicates.
|
1492
1515
|
function addTypeVarsToListIfUnique(list1, list2, typeVarScopeId) {
|
@@ -1499,7 +1522,6 @@ function addTypeVarsToListIfUnique(list1, list2, typeVarScopeId) {
|
|
1499
1522
|
}
|
1500
1523
|
}
|
1501
1524
|
}
|
1502
|
-
exports.addTypeVarsToListIfUnique = addTypeVarsToListIfUnique;
|
1503
1525
|
// Walks the type recursively (in a depth-first manner), finds all
|
1504
1526
|
// type variables that are referenced, and returns an ordered list
|
1505
1527
|
// of unique type variables. For example, if the type is
|
@@ -1560,7 +1582,6 @@ function getTypeVarArgsRecursive(type, recursionCount = 0) {
|
|
1560
1582
|
}
|
1561
1583
|
return [];
|
1562
1584
|
}
|
1563
|
-
exports.getTypeVarArgsRecursive = getTypeVarArgsRecursive;
|
1564
1585
|
// Creates a specialized version of the class, filling in any unspecified
|
1565
1586
|
// type arguments with Unknown.
|
1566
1587
|
function specializeClassType(type) {
|
@@ -1571,66 +1592,6 @@ function specializeClassType(type) {
|
|
1571
1592
|
});
|
1572
1593
|
return applySolvedTypeVars(type, solution);
|
1573
1594
|
}
|
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
1595
|
// Builds a mapping between type parameters and their specialized
|
1635
1596
|
// types. For example, if the generic type is Dict[_T1, _T2] and the
|
1636
1597
|
// specialized type is Dict[str, int], it returns a map that associates
|
@@ -1649,7 +1610,6 @@ function buildSolutionFromSpecializedClass(classType) {
|
|
1649
1610
|
}
|
1650
1611
|
return buildSolution(typeParams, typeArgs);
|
1651
1612
|
}
|
1652
|
-
exports.buildSolutionFromSpecializedClass = buildSolutionFromSpecializedClass;
|
1653
1613
|
function buildSolution(typeParams, typeArgs) {
|
1654
1614
|
const solution = new constraintSolution_1.ConstraintSolution();
|
1655
1615
|
if (!typeArgs) {
|
@@ -1662,7 +1622,6 @@ function buildSolution(typeParams, typeArgs) {
|
|
1662
1622
|
});
|
1663
1623
|
return solution;
|
1664
1624
|
}
|
1665
|
-
exports.buildSolution = buildSolution;
|
1666
1625
|
// Determines the specialized base class type that srcType derives from.
|
1667
1626
|
function specializeForBaseClass(srcType, baseClass) {
|
1668
1627
|
const typeParams = types_1.ClassType.getTypeParams(baseClass);
|
@@ -1676,11 +1635,9 @@ function specializeForBaseClass(srcType, baseClass) {
|
|
1676
1635
|
(0, debug_1.assert)((0, types_1.isInstantiableClass)(specializedType));
|
1677
1636
|
return specializedType;
|
1678
1637
|
}
|
1679
|
-
exports.specializeForBaseClass = specializeForBaseClass;
|
1680
1638
|
function derivesFromStdlibClass(classType, className) {
|
1681
1639
|
return classType.shared.mro.some((mroClass) => (0, types_1.isClass)(mroClass) && types_1.ClassType.isBuiltIn(mroClass, className));
|
1682
1640
|
}
|
1683
|
-
exports.derivesFromStdlibClass = derivesFromStdlibClass;
|
1684
1641
|
// If ignoreUnknown is true, an unknown base class is ignored when
|
1685
1642
|
// checking for derivation. If ignoreUnknown is false, a return value
|
1686
1643
|
// of true is assumed.
|
@@ -1701,7 +1658,6 @@ function derivesFromClassRecursive(classType, baseClassToFind, ignoreUnknown) {
|
|
1701
1658
|
}
|
1702
1659
|
return false;
|
1703
1660
|
}
|
1704
|
-
exports.derivesFromClassRecursive = derivesFromClassRecursive;
|
1705
1661
|
function synthesizeTypeVarForSelfCls(classType, isClsParam) {
|
1706
1662
|
var _a;
|
1707
1663
|
const selfType = types_1.TypeVarType.createInstance(`__type_of_self__`);
|
@@ -1717,7 +1673,6 @@ function synthesizeTypeVarForSelfCls(classType, isClsParam) {
|
|
1717
1673
|
selfType.shared.boundType = types_1.ClassType.cloneAsInstance(boundType);
|
1718
1674
|
return isClsParam ? types_1.TypeVarType.cloneAsInstantiable(selfType) : selfType;
|
1719
1675
|
}
|
1720
|
-
exports.synthesizeTypeVarForSelfCls = synthesizeTypeVarForSelfCls;
|
1721
1676
|
// Returns the declared "return" type (the type returned from a return statement)
|
1722
1677
|
// if it was declared, or undefined otherwise.
|
1723
1678
|
function getDeclaredGeneratorReturnType(functionType) {
|
@@ -1731,7 +1686,6 @@ function getDeclaredGeneratorReturnType(functionType) {
|
|
1731
1686
|
}
|
1732
1687
|
return undefined;
|
1733
1688
|
}
|
1734
|
-
exports.getDeclaredGeneratorReturnType = getDeclaredGeneratorReturnType;
|
1735
1689
|
// If the declared return type is a Generator, Iterable, Iterator or the async
|
1736
1690
|
// counterparts, returns the yield type. If the type is invalid for a generator,
|
1737
1691
|
// returns undefined.
|
@@ -1759,17 +1713,14 @@ function getGeneratorYieldType(declaredReturnType, isAsync) {
|
|
1759
1713
|
});
|
1760
1714
|
return isLegalGeneratorType ? yieldType : undefined;
|
1761
1715
|
}
|
1762
|
-
exports.getGeneratorYieldType = getGeneratorYieldType;
|
1763
1716
|
function isInstantiableMetaclass(type) {
|
1764
1717
|
return ((0, types_1.isInstantiableClass)(type) &&
|
1765
1718
|
type.shared.mro.some((mroClass) => (0, types_1.isClass)(mroClass) && types_1.ClassType.isBuiltIn(mroClass, 'type')));
|
1766
1719
|
}
|
1767
|
-
exports.isInstantiableMetaclass = isInstantiableMetaclass;
|
1768
1720
|
function isMetaclassInstance(type) {
|
1769
1721
|
return ((0, types_1.isClassInstance)(type) &&
|
1770
1722
|
type.shared.mro.some((mroClass) => (0, types_1.isClass)(mroClass) && types_1.ClassType.isBuiltIn(mroClass, 'type')));
|
1771
1723
|
}
|
1772
|
-
exports.isMetaclassInstance = isMetaclassInstance;
|
1773
1724
|
function isEffectivelyInstantiable(type, options, recursionCount = 0) {
|
1774
1725
|
if (recursionCount > types_1.maxTypeRecursionCount) {
|
1775
1726
|
return false;
|
@@ -1793,7 +1744,6 @@ function isEffectivelyInstantiable(type, options, recursionCount = 0) {
|
|
1793
1744
|
}
|
1794
1745
|
return false;
|
1795
1746
|
}
|
1796
|
-
exports.isEffectivelyInstantiable = isEffectivelyInstantiable;
|
1797
1747
|
function convertToInstance(type, includeSubclasses = true) {
|
1798
1748
|
var _a, _b;
|
1799
1749
|
// See if we've already performed this conversion and cached it.
|
@@ -1866,7 +1816,6 @@ function convertToInstance(type, includeSubclasses = true) {
|
|
1866
1816
|
}
|
1867
1817
|
return result;
|
1868
1818
|
}
|
1869
|
-
exports.convertToInstance = convertToInstance;
|
1870
1819
|
function convertToInstantiable(type, includeSubclasses = true) {
|
1871
1820
|
var _a;
|
1872
1821
|
// See if we've already performed this conversion and cached it.
|
@@ -1896,7 +1845,6 @@ function convertToInstantiable(type, includeSubclasses = true) {
|
|
1896
1845
|
}
|
1897
1846
|
return result;
|
1898
1847
|
}
|
1899
|
-
exports.convertToInstantiable = convertToInstantiable;
|
1900
1848
|
function getMembersForClass(classType, symbolTable, includeInstanceVars) {
|
1901
1849
|
classType.shared.mro.forEach((mroClass) => {
|
1902
1850
|
if ((0, types_1.isInstantiableClass)(mroClass)) {
|
@@ -1946,7 +1894,6 @@ function getMembersForClass(classType, symbolTable, includeInstanceVars) {
|
|
1946
1894
|
}
|
1947
1895
|
}
|
1948
1896
|
}
|
1949
|
-
exports.getMembersForClass = getMembersForClass;
|
1950
1897
|
function getMembersForModule(moduleType, symbolTable) {
|
1951
1898
|
// Start with the loader fields. If there are any symbols of the
|
1952
1899
|
// same name defined within the module, they will overwrite the
|
@@ -1960,7 +1907,6 @@ function getMembersForModule(moduleType, symbolTable) {
|
|
1960
1907
|
symbolTable.set(name, symbol);
|
1961
1908
|
});
|
1962
1909
|
}
|
1963
|
-
exports.getMembersForModule = getMembersForModule;
|
1964
1910
|
// Determines if the type contains an Any recursively.
|
1965
1911
|
function containsAnyRecursive(type, includeUnknown = true) {
|
1966
1912
|
class AnyWalker extends typeWalker_1.TypeWalker {
|
@@ -1984,7 +1930,6 @@ function containsAnyRecursive(type, includeUnknown = true) {
|
|
1984
1930
|
walker.walk(type);
|
1985
1931
|
return walker.foundAny;
|
1986
1932
|
}
|
1987
|
-
exports.containsAnyRecursive = containsAnyRecursive;
|
1988
1933
|
// Determines if the type contains an Any or Unknown type. If so,
|
1989
1934
|
// it returns the Any or Unknown type. Unknowns are preferred over
|
1990
1935
|
// Any if both are present. If recurse is true, it will recurse
|
@@ -2025,7 +1970,6 @@ function containsAnyOrUnknown(type, recurse) {
|
|
2025
1970
|
walker.walk(type);
|
2026
1971
|
return walker.anyOrUnknownType;
|
2027
1972
|
}
|
2028
|
-
exports.containsAnyOrUnknown = containsAnyOrUnknown;
|
2029
1973
|
// Determines if any part of the type contains "Unknown", including any type arguments.
|
2030
1974
|
// This function does not use the TypeWalker because it is called very frequently,
|
2031
1975
|
// and allocating a memory walker object for every call significantly increases
|
@@ -2072,8 +2016,8 @@ function isPartlyUnknown(type, recursionCount = 0) {
|
|
2072
2016
|
return false;
|
2073
2017
|
}
|
2074
2018
|
// See if a function has an unknown type.
|
2075
|
-
if ((0, types_1.
|
2076
|
-
return types_1.
|
2019
|
+
if ((0, types_1.isOverloaded)(type)) {
|
2020
|
+
return types_1.OverloadedType.getOverloads(type).some((overload) => {
|
2077
2021
|
return isPartlyUnknown(overload, recursionCount);
|
2078
2022
|
});
|
2079
2023
|
}
|
@@ -2096,7 +2040,6 @@ function isPartlyUnknown(type, recursionCount = 0) {
|
|
2096
2040
|
}
|
2097
2041
|
return false;
|
2098
2042
|
}
|
2099
|
-
exports.isPartlyUnknown = isPartlyUnknown;
|
2100
2043
|
// If the specified type is a generic class with a single type argument
|
2101
2044
|
// that is a union, it "explodes" the class into a union of classes with
|
2102
2045
|
// each element of the union - e.g. Foo[A | B] becomes Foo[A] | Foo[B].
|
@@ -2108,7 +2051,6 @@ function explodeGenericClass(classType) {
|
|
2108
2051
|
return types_1.ClassType.specialize(classType, [subtype]);
|
2109
2052
|
}));
|
2110
2053
|
}
|
2111
|
-
exports.explodeGenericClass = explodeGenericClass;
|
2112
2054
|
// If the type is a union of same-sized tuples, these are combined into
|
2113
2055
|
// a single tuple with that size. Otherwise, returns undefined.
|
2114
2056
|
function combineSameSizedTuples(type, tupleType) {
|
@@ -2158,7 +2100,6 @@ function combineSameSizedTuples(type, tupleType) {
|
|
2158
2100
|
return { type: (0, types_1.combineTypes)(entry), isUnbounded: false };
|
2159
2101
|
})));
|
2160
2102
|
}
|
2161
|
-
exports.combineSameSizedTuples = combineSameSizedTuples;
|
2162
2103
|
function combineTupleTypeArgs(typeArgs) {
|
2163
2104
|
return (0, types_1.combineTypes)(typeArgs.map((t) => {
|
2164
2105
|
if ((0, types_1.isTypeVar)(t.type) && (0, types_1.isUnpackedTypeVarTuple)(t.type)) {
|
@@ -2168,7 +2109,6 @@ function combineTupleTypeArgs(typeArgs) {
|
|
2168
2109
|
return t.type;
|
2169
2110
|
}));
|
2170
2111
|
}
|
2171
|
-
exports.combineTupleTypeArgs = combineTupleTypeArgs;
|
2172
2112
|
// Tuples require special handling for specialization. This method computes
|
2173
2113
|
// the "effective" type argument, which is a union of the variadic type
|
2174
2114
|
// arguments.
|
@@ -2180,7 +2120,6 @@ function specializeTupleClass(classType, typeArgs, isTypeArgExplicit = true, isU
|
|
2180
2120
|
}
|
2181
2121
|
return clonedClassType;
|
2182
2122
|
}
|
2183
|
-
exports.specializeTupleClass = specializeTupleClass;
|
2184
2123
|
function _expandUnpackedTypeVarTupleUnion(type) {
|
2185
2124
|
if ((0, types_1.isClassInstance)(type) && isTupleClass(type) && type.priv.tupleTypeArgs && type.priv.isUnpacked) {
|
2186
2125
|
return (0, types_1.combineTypes)(type.priv.tupleTypeArgs.map((t) => t.type));
|
@@ -2203,7 +2142,6 @@ function getGeneratorTypeArgs(returnType) {
|
|
2203
2142
|
}
|
2204
2143
|
return undefined;
|
2205
2144
|
}
|
2206
|
-
exports.getGeneratorTypeArgs = getGeneratorTypeArgs;
|
2207
2145
|
function requiresTypeArgs(classType) {
|
2208
2146
|
if (classType.shared.typeParams.length > 0) {
|
2209
2147
|
const firstTypeParam = classType.shared.typeParams[0];
|
@@ -2241,7 +2179,6 @@ function requiresTypeArgs(classType) {
|
|
2241
2179
|
}
|
2242
2180
|
return false;
|
2243
2181
|
}
|
2244
|
-
exports.requiresTypeArgs = requiresTypeArgs;
|
2245
2182
|
function requiresSpecialization(type, options, recursionCount = 0) {
|
2246
2183
|
var _a;
|
2247
2184
|
if (recursionCount > types_1.maxTypeRecursionCount) {
|
@@ -2262,7 +2199,6 @@ function requiresSpecialization(type, options, recursionCount = 0) {
|
|
2262
2199
|
}
|
2263
2200
|
return result;
|
2264
2201
|
}
|
2265
|
-
exports.requiresSpecialization = requiresSpecialization;
|
2266
2202
|
function _requiresSpecialization(type, options, recursionCount = 0) {
|
2267
2203
|
var _a, _b;
|
2268
2204
|
// If the type is conditioned on a TypeVar, it may need to be specialized.
|
@@ -2303,8 +2239,16 @@ function _requiresSpecialization(type, options, recursionCount = 0) {
|
|
2303
2239
|
}
|
2304
2240
|
return false;
|
2305
2241
|
}
|
2306
|
-
case 5 /* TypeCategory.
|
2307
|
-
|
2242
|
+
case 5 /* TypeCategory.Overloaded */: {
|
2243
|
+
const overloads = types_1.OverloadedType.getOverloads(type);
|
2244
|
+
if (overloads.some((overload) => requiresSpecialization(overload, options, recursionCount))) {
|
2245
|
+
return true;
|
2246
|
+
}
|
2247
|
+
const impl = types_1.OverloadedType.getImplementation(type);
|
2248
|
+
if (impl) {
|
2249
|
+
return requiresSpecialization(impl, options, recursionCount);
|
2250
|
+
}
|
2251
|
+
return false;
|
2308
2252
|
}
|
2309
2253
|
case 8 /* TypeCategory.Union */: {
|
2310
2254
|
return type.priv.subtypes.some((subtype) => requiresSpecialization(subtype, options, recursionCount));
|
@@ -2339,7 +2283,6 @@ function combineVariances(variance1, variance2) {
|
|
2339
2283
|
}
|
2340
2284
|
return variance1;
|
2341
2285
|
}
|
2342
|
-
exports.combineVariances = combineVariances;
|
2343
2286
|
// Determines if the variance of the type argument for a generic class is compatible
|
2344
2287
|
// With the declared variance of the corresponding type parameter.
|
2345
2288
|
function isVarianceOfTypeArgCompatible(type, typeParamVariance) {
|
@@ -2388,7 +2331,6 @@ function isVarianceOfTypeArgCompatible(type, typeParamVariance) {
|
|
2388
2331
|
}
|
2389
2332
|
return true;
|
2390
2333
|
}
|
2391
|
-
exports.isVarianceOfTypeArgCompatible = isVarianceOfTypeArgCompatible;
|
2392
2334
|
// Computes the method resolution ordering for a class whose base classes
|
2393
2335
|
// have already been filled in. The algorithm for computing MRO is described
|
2394
2336
|
// here: https://www.python.org/download/releases/2.3/mro/. It returns true
|
@@ -2518,7 +2460,6 @@ function computeMroLinearization(classType) {
|
|
2518
2460
|
}
|
2519
2461
|
return isMroFound;
|
2520
2462
|
}
|
2521
|
-
exports.computeMroLinearization = computeMroLinearization;
|
2522
2463
|
// Returns zero or more unique module names that point to the place(s)
|
2523
2464
|
// where the type is declared. Unions, for example, can result in more
|
2524
2465
|
// than one result. Type arguments are not included.
|
@@ -2527,7 +2468,6 @@ function getDeclaringModulesForType(type) {
|
|
2527
2468
|
addDeclaringModuleNamesForType(type, moduleList);
|
2528
2469
|
return moduleList;
|
2529
2470
|
}
|
2530
|
-
exports.getDeclaringModulesForType = getDeclaringModulesForType;
|
2531
2471
|
function convertNodeToArg(node) {
|
2532
2472
|
return {
|
2533
2473
|
argCategory: node.d.argCategory,
|
@@ -2535,7 +2475,6 @@ function convertNodeToArg(node) {
|
|
2535
2475
|
valueExpression: node.d.valueExpr,
|
2536
2476
|
};
|
2537
2477
|
}
|
2538
|
-
exports.convertNodeToArg = convertNodeToArg;
|
2539
2478
|
function addDeclaringModuleNamesForType(type, moduleList, recursionCount = 0) {
|
2540
2479
|
if (recursionCount > types_1.maxTypeRecursionCount) {
|
2541
2480
|
return;
|
@@ -2555,10 +2494,15 @@ function addDeclaringModuleNamesForType(type, moduleList, recursionCount = 0) {
|
|
2555
2494
|
addIfUnique(type.shared.moduleName);
|
2556
2495
|
break;
|
2557
2496
|
}
|
2558
|
-
case 5 /* TypeCategory.
|
2559
|
-
|
2497
|
+
case 5 /* TypeCategory.Overloaded */: {
|
2498
|
+
const overloads = types_1.OverloadedType.getOverloads(type);
|
2499
|
+
overloads.forEach((overload) => {
|
2560
2500
|
addDeclaringModuleNamesForType(overload, moduleList, recursionCount);
|
2561
2501
|
});
|
2502
|
+
const impl = types_1.OverloadedType.getImplementation(type);
|
2503
|
+
if (impl) {
|
2504
|
+
addDeclaringModuleNamesForType(impl, moduleList, recursionCount);
|
2505
|
+
}
|
2562
2506
|
break;
|
2563
2507
|
}
|
2564
2508
|
case 8 /* TypeCategory.Union */: {
|
@@ -2599,7 +2543,6 @@ function convertTypeToParamSpecValue(type) {
|
|
2599
2543
|
}
|
2600
2544
|
return types_1.ParamSpecType.getUnknown();
|
2601
2545
|
}
|
2602
|
-
exports.convertTypeToParamSpecValue = convertTypeToParamSpecValue;
|
2603
2546
|
// Converts a FunctionType into a ParamSpec if it consists only of
|
2604
2547
|
// (* args: P.args, ** kwargs: P.kwargs). Otherwise returns the original type.
|
2605
2548
|
function simplifyFunctionToParamSpec(type) {
|
@@ -2620,7 +2563,6 @@ function simplifyFunctionToParamSpec(type) {
|
|
2620
2563
|
}
|
2621
2564
|
return type;
|
2622
2565
|
}
|
2623
|
-
exports.simplifyFunctionToParamSpec = simplifyFunctionToParamSpec;
|
2624
2566
|
// Recursively walks a type and calls a callback for each TypeVar, allowing
|
2625
2567
|
// it to be replaced with something else.
|
2626
2568
|
class TypeVarTransformer {
|
@@ -2746,7 +2688,7 @@ class TypeVarTransformer {
|
|
2746
2688
|
this._pendingFunctionTransformations.pop();
|
2747
2689
|
return result;
|
2748
2690
|
}
|
2749
|
-
if ((0, types_1.
|
2691
|
+
if ((0, types_1.isOverloaded)(type)) {
|
2750
2692
|
// Prevent recursion.
|
2751
2693
|
if (this._pendingFunctionTransformations.some((t) => t === type)) {
|
2752
2694
|
return type;
|
@@ -2754,22 +2696,31 @@ class TypeVarTransformer {
|
|
2754
2696
|
this._pendingFunctionTransformations.push(type);
|
2755
2697
|
let requiresUpdate = false;
|
2756
2698
|
// Specialize each of the functions in the overload.
|
2699
|
+
const overloads = types_1.OverloadedType.getOverloads(type);
|
2757
2700
|
const newOverloads = [];
|
2758
|
-
|
2701
|
+
overloads.forEach((entry) => {
|
2759
2702
|
const replacementType = this.transformTypeVarsInFunctionType(entry, recursionCount);
|
2760
2703
|
if ((0, types_1.isFunction)(replacementType)) {
|
2761
2704
|
newOverloads.push(replacementType);
|
2762
2705
|
}
|
2763
2706
|
else {
|
2764
|
-
(0, collectionUtils_1.appendArray)(newOverloads,
|
2707
|
+
(0, collectionUtils_1.appendArray)(newOverloads, types_1.OverloadedType.getOverloads(replacementType));
|
2765
2708
|
}
|
2766
2709
|
if (replacementType !== entry) {
|
2767
2710
|
requiresUpdate = true;
|
2768
2711
|
}
|
2769
2712
|
});
|
2713
|
+
const impl = types_1.OverloadedType.getImplementation(type);
|
2714
|
+
let newImpl = impl;
|
2715
|
+
if (impl) {
|
2716
|
+
newImpl = this.apply(impl, recursionCount);
|
2717
|
+
if (newImpl !== impl) {
|
2718
|
+
requiresUpdate = true;
|
2719
|
+
}
|
2720
|
+
}
|
2770
2721
|
this._pendingFunctionTransformations.pop();
|
2771
2722
|
// Construct a new overload with the specialized function types.
|
2772
|
-
return requiresUpdate ? types_1.
|
2723
|
+
return requiresUpdate ? types_1.OverloadedType.create(newOverloads, newImpl) : type;
|
2773
2724
|
}
|
2774
2725
|
return type;
|
2775
2726
|
}
|
@@ -3089,7 +3040,7 @@ class UniqueFunctionSignatureTransformer extends TypeVarTransformer {
|
|
3089
3040
|
}
|
3090
3041
|
});
|
3091
3042
|
updatedSourceType = applySolvedTypeVars(sourceType, solution);
|
3092
|
-
(0, debug_1.assert)((0, types_1.isFunction)(updatedSourceType) || (0, types_1.
|
3043
|
+
(0, debug_1.assert)((0, types_1.isFunction)(updatedSourceType) || (0, types_1.isOverloaded)(updatedSourceType));
|
3093
3044
|
}
|
3094
3045
|
}
|
3095
3046
|
this._signatureTracker.addSignature(sourceType, this._expressionOffset);
|
@@ -3333,7 +3284,7 @@ class ApplySolvedTypeVarsTransformer extends TypeVarTransformer {
|
|
3333
3284
|
if (filteredOverloads.length === 1) {
|
3334
3285
|
return filteredOverloads[0];
|
3335
3286
|
}
|
3336
|
-
return types_1.
|
3287
|
+
return types_1.OverloadedType.create(filteredOverloads);
|
3337
3288
|
}
|
3338
3289
|
// Handle the case where we need the default replacement value for a typeVar
|
3339
3290
|
// that has no scope and therefore doesn't have an assigned scopeID. We'll
|