@zzzen/pyright-internal 1.2.0-dev.20240728 → 1.2.0-dev.20240811
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +8 -5
- 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 +4 -1
- package/dist/analyzer/checker.js +371 -254
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/circularDependency.js.map +1 -1
- package/dist/analyzer/codeFlowEngine.js +10 -10
- 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 +22 -0
- package/dist/analyzer/constraintSolution.js +77 -0
- package/dist/analyzer/constraintSolution.js.map +1 -0
- package/dist/analyzer/constraintSolver.d.ts +8 -5
- package/dist/analyzer/constraintSolver.js +427 -353
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/constraintTracker.d.ts +45 -0
- package/dist/analyzer/constraintTracker.js +235 -0
- package/dist/analyzer/constraintTracker.js.map +1 -0
- package/dist/analyzer/constructorTransform.js +23 -23
- package/dist/analyzer/constructorTransform.js.map +1 -1
- package/dist/analyzer/constructors.d.ts +1 -1
- package/dist/analyzer/constructors.js +71 -51
- package/dist/analyzer/constructors.js.map +1 -1
- package/dist/analyzer/dataClasses.js +72 -58
- 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 +34 -30
- 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 +2 -3
- 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.d.ts +1 -2
- package/dist/analyzer/operations.js +101 -79
- 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 +17 -13
- package/dist/analyzer/packageTypeVerifier.js.map +1 -1
- package/dist/analyzer/parameterUtils.d.ts +3 -3
- package/dist/analyzer/parameterUtils.js +23 -25
- 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 +39 -41
- 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.d.ts +3 -2
- package/dist/analyzer/properties.js +16 -18
- package/dist/analyzer/properties.js.map +1 -1
- package/dist/analyzer/protocols.d.ts +3 -3
- package/dist/analyzer/protocols.js +58 -60
- 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 +2 -2
- package/dist/analyzer/tuples.js +14 -14
- package/dist/analyzer/tuples.js.map +1 -1
- package/dist/analyzer/typeCacheUtils.js.map +1 -1
- package/dist/analyzer/typeComplexity.js +14 -7
- 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 +1021 -993
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +31 -13
- 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 +72 -64
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typePrinter.js +28 -26
- package/dist/analyzer/typePrinter.js.map +1 -1
- package/dist/analyzer/typeStubWriter.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +36 -38
- package/dist/analyzer/typeUtils.js +465 -746
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typeWalker.d.ts +2 -2
- package/dist/analyzer/typeWalker.js +10 -5
- package/dist/analyzer/typeWalker.js.map +1 -1
- package/dist/analyzer/typedDicts.d.ts +2 -2
- package/dist/analyzer/typedDicts.js +52 -52
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +41 -36
- package/dist/analyzer/types.js +178 -184
- 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.d.ts +2 -2
- package/dist/languageServerBase.js +5 -2
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/analyzerServiceExecutor.js +30 -29
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
- package/dist/languageService/autoImporter.js +4 -4
- package/dist/languageService/autoImporter.js.map +1 -1
- package/dist/languageService/callHierarchyProvider.js.map +1 -1
- package/dist/languageService/codeActionProvider.js.map +1 -1
- package/dist/languageService/completionProvider.js +4 -4
- package/dist/languageService/completionProvider.js.map +1 -1
- package/dist/languageService/completionProviderUtils.js +4 -5
- package/dist/languageService/completionProviderUtils.js.map +1 -1
- package/dist/languageService/definitionProvider.js +5 -5
- package/dist/languageService/definitionProvider.js.map +1 -1
- package/dist/languageService/documentHighlightProvider.js.map +1 -1
- package/dist/languageService/documentSymbolCollector.js +3 -3
- package/dist/languageService/documentSymbolCollector.js.map +1 -1
- package/dist/languageService/documentSymbolProvider.js +2 -2
- package/dist/languageService/documentSymbolProvider.js.map +1 -1
- package/dist/languageService/dynamicFeature.js.map +1 -1
- package/dist/languageService/fileWatcherDynamicFeature.js.map +1 -1
- package/dist/languageService/hoverProvider.js +6 -6
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/importSorter.js.map +1 -1
- package/dist/languageService/navigationUtils.js +3 -4
- package/dist/languageService/navigationUtils.js.map +1 -1
- package/dist/languageService/quickActions.js +1 -2
- package/dist/languageService/quickActions.js.map +1 -1
- package/dist/languageService/referencesProvider.js.map +1 -1
- package/dist/languageService/renameProvider.js.map +1 -1
- package/dist/languageService/signatureHelpProvider.js.map +1 -1
- package/dist/languageService/symbolIndexer.js.map +1 -1
- package/dist/languageService/tooltipUtils.d.ts +5 -5
- package/dist/languageService/tooltipUtils.js +31 -31
- package/dist/languageService/tooltipUtils.js.map +1 -1
- package/dist/languageService/workspaceSymbolProvider.js.map +1 -1
- package/dist/localization/localize.d.ts +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 +13 -5
- 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 +7 -7
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +20 -0
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +6 -2
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +3 -3
- package/dist/tests/typeEvaluator5.test.js +1 -1
- package/dist/tests/typeEvaluator6.test.js +17 -9
- package/dist/tests/typeEvaluator6.test.js.map +1 -1
- package/dist/tests/typeEvaluator7.test.js +4 -0
- package/dist/tests/typeEvaluator7.test.js.map +1 -1
- package/dist/tests/typeEvaluator8.test.js +4 -0
- package/dist/tests/typeEvaluator8.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
- package/dist/analyzer/typeVarContext.d.ts +0 -48
- package/dist/analyzer/typeVarContext.js +0 -288
- package/dist/analyzer/typeVarContext.js.map +0 -1
package/dist/analyzer/checker.js
CHANGED
@@ -50,6 +50,7 @@ const localize_1 = require("../localization/localize");
|
|
50
50
|
const parseNodes_1 = require("../parser/parseNodes");
|
51
51
|
const stringTokenUtils_1 = require("../parser/stringTokenUtils");
|
52
52
|
const AnalyzerNodeInfo = __importStar(require("./analyzerNodeInfo"));
|
53
|
+
const constraintTracker_1 = require("./constraintTracker");
|
53
54
|
const constructors_1 = require("./constructors");
|
54
55
|
const dataClasses_1 = require("./dataClasses");
|
55
56
|
const declaration_1 = require("./declaration");
|
@@ -69,13 +70,12 @@ const sourceMapper_1 = require("./sourceMapper");
|
|
69
70
|
const staticExpressions_1 = require("./staticExpressions");
|
70
71
|
const SymbolNameUtils = __importStar(require("./symbolNameUtils"));
|
71
72
|
const symbolUtils_1 = require("./symbolUtils");
|
73
|
+
const typedDicts_1 = require("./typedDicts");
|
72
74
|
const typeEvaluator_1 = require("./typeEvaluator");
|
73
75
|
const typeEvaluatorTypes_1 = require("./typeEvaluatorTypes");
|
74
76
|
const typeGuards_1 = require("./typeGuards");
|
75
|
-
const typeUtils_1 = require("./typeUtils");
|
76
|
-
const typeVarContext_1 = require("./typeVarContext");
|
77
|
-
const typedDicts_1 = require("./typedDicts");
|
78
77
|
const types_1 = require("./types");
|
78
|
+
const typeUtils_1 = require("./typeUtils");
|
79
79
|
// When enabled, this debug flag causes the code complexity of
|
80
80
|
// functions to be emitted.
|
81
81
|
const isPrintCodeComplexityEnabled = false;
|
@@ -248,14 +248,15 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
248
248
|
}
|
249
249
|
// Allow unknown and missing param types if the param is named '_'.
|
250
250
|
if (param.d.name && param.d.name.d.value !== '_') {
|
251
|
-
const
|
252
|
-
if (
|
253
|
-
const
|
251
|
+
const paramIndex = functionTypeResult.functionType.shared.parameters.findIndex((p) => { var _a; return p.name === ((_a = param.d.name) === null || _a === void 0 ? void 0 : _a.d.value); });
|
252
|
+
if (paramIndex >= 0) {
|
253
|
+
const functionTypeParam = functionTypeResult.functionType.shared.parameters[paramIndex];
|
254
|
+
const paramType = types_1.FunctionType.getParamType(functionTypeResult.functionType, paramIndex);
|
254
255
|
if (this._fileInfo.diagnosticRuleSet.reportUnknownParameterType !== 'none') {
|
255
256
|
if ((0, types_1.isUnknown)(paramType) ||
|
256
257
|
((0, types_1.isTypeVar)(paramType) &&
|
257
258
|
paramType.shared.isSynthesized &&
|
258
|
-
!
|
259
|
+
!types_1.TypeVarType.isSelf(paramType))) {
|
259
260
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportUnknownParameterType, localize_1.LocMessage.paramTypeUnknown().format({ paramName: param.d.name.d.value }), param.d.name);
|
260
261
|
}
|
261
262
|
else if ((0, typeUtils_1.isPartlyUnknown)(paramType)) {
|
@@ -274,7 +275,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
274
275
|
}
|
275
276
|
else {
|
276
277
|
// See if this is a "self" and "cls" parameter. They are exempt from this rule.
|
277
|
-
if ((0, types_1.isTypeVar)(paramType) &&
|
278
|
+
if ((0, types_1.isTypeVar)(paramType) && types_1.TypeVarType.isSelf(paramType)) {
|
278
279
|
hasAnnotation = true;
|
279
280
|
}
|
280
281
|
}
|
@@ -287,7 +288,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
287
288
|
// Verify that an unpacked TypedDict doesn't overlap any keyword parameters.
|
288
289
|
if (paramDetails.hasUnpackedTypedDict) {
|
289
290
|
const kwargsIndex = functionTypeResult.functionType.shared.parameters.length - 1;
|
290
|
-
const kwargsType = types_1.FunctionType.
|
291
|
+
const kwargsType = types_1.FunctionType.getParamType(functionTypeResult.functionType, kwargsIndex);
|
291
292
|
if ((0, types_1.isClass)(kwargsType) && kwargsType.shared.typedDictEntries) {
|
292
293
|
const overlappingEntries = new Set();
|
293
294
|
kwargsType.shared.typedDictEntries.knownItems.forEach((_, name) => {
|
@@ -303,9 +304,10 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
303
304
|
}
|
304
305
|
}
|
305
306
|
// Check for invalid use of ParamSpec P.args and P.kwargs.
|
306
|
-
const paramSpecParams = functionTypeResult.functionType.shared.parameters.filter((param) => {
|
307
|
-
|
308
|
-
|
307
|
+
const paramSpecParams = functionTypeResult.functionType.shared.parameters.filter((param, index) => {
|
308
|
+
const paramType = types_1.FunctionType.getParamType(functionTypeResult.functionType, index);
|
309
|
+
if (types_1.FunctionParam.isTypeDeclared(param) && (0, types_1.isTypeVar)(paramType) && (0, types_1.isParamSpec)(paramType)) {
|
310
|
+
if (param.category !== 0 /* ParamCategory.Simple */ && param.name && paramType.priv.paramSpecAccess) {
|
309
311
|
return true;
|
310
312
|
}
|
311
313
|
}
|
@@ -343,10 +345,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
343
345
|
if (functionTypeResult) {
|
344
346
|
const annotationNode = param.d.annotation || param.d.annotationComment;
|
345
347
|
if (annotationNode && index < functionTypeResult.functionType.shared.parameters.length) {
|
346
|
-
const paramType = functionTypeResult.functionType
|
348
|
+
const paramType = types_1.FunctionType.getParamType(functionTypeResult.functionType, index);
|
347
349
|
const exemptMethods = ['__init__', '__new__'];
|
348
350
|
if (containingClassNode &&
|
349
351
|
(0, types_1.isTypeVar)(paramType) &&
|
352
|
+
paramType.priv.scopeType === 0 /* TypeVarScopeType.Class */ &&
|
350
353
|
paramType.shared.declaredVariance === 3 /* Variance.Covariant */ &&
|
351
354
|
!paramType.shared.isSynthesized &&
|
352
355
|
!exemptMethods.some((name) => name === functionTypeResult.functionType.shared.name)) {
|
@@ -409,12 +412,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
409
412
|
}
|
410
413
|
}
|
411
414
|
this._scopedNodes.push(node);
|
412
|
-
if (functionTypeResult && (0, types_1.
|
415
|
+
if (functionTypeResult && (0, types_1.isOverloaded)(functionTypeResult.decoratedType)) {
|
413
416
|
// If this is the implementation for the overloaded function, skip
|
414
417
|
// overload consistency checks.
|
415
|
-
if (types_1.
|
416
|
-
functionTypeResult.
|
417
|
-
const overloads = types_1.OverloadedFunctionType.getOverloads(functionTypeResult.decoratedType);
|
418
|
+
if (types_1.OverloadedType.getImplementation(functionTypeResult.decoratedType) !== functionTypeResult.functionType) {
|
419
|
+
const overloads = types_1.OverloadedType.getOverloads(functionTypeResult.decoratedType);
|
418
420
|
if (overloads.length > 1) {
|
419
421
|
const maxOverloadConsistencyCheckLength = 100;
|
420
422
|
// The check is n^2 in time, so if the number of overloads
|
@@ -579,33 +581,31 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
579
581
|
}
|
580
582
|
else {
|
581
583
|
const liveScopes = ParseTreeUtils.getTypeVarScopesForNode(node);
|
582
|
-
declaredReturnType = (0, typeUtils_1.updateTypeWithInternalTypeVars)(declaredReturnType, liveScopes);
|
583
584
|
declaredReturnType = this._evaluator.stripTypeGuard(declaredReturnType);
|
585
|
+
let adjReturnType = (0, typeUtils_1.makeTypeVarsBound)(declaredReturnType, liveScopes);
|
584
586
|
let diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
585
587
|
let returnTypeMatches = false;
|
586
|
-
if (this._evaluator.assignType(
|
587
|
-
/* destTypeVarContext */ new typeVarContext_1.TypeVarContext())) {
|
588
|
+
if (this._evaluator.assignType(adjReturnType, returnType, diagAddendum)) {
|
588
589
|
returnTypeMatches = true;
|
589
590
|
}
|
590
591
|
else {
|
591
592
|
// See if the declared return type includes one or more constrained TypeVars. If so,
|
592
593
|
// try to narrow these TypeVars to a single type.
|
593
594
|
const uniqueTypeVars = (0, typeUtils_1.getTypeVarArgsRecursive)(declaredReturnType);
|
594
|
-
if (uniqueTypeVars && uniqueTypeVars.some((typeVar) =>
|
595
|
-
const
|
595
|
+
if (uniqueTypeVars && uniqueTypeVars.some((typeVar) => types_1.TypeVarType.hasConstraints(typeVar))) {
|
596
|
+
const constraints = new constraintTracker_1.ConstraintTracker();
|
596
597
|
for (const typeVar of uniqueTypeVars) {
|
597
|
-
if (
|
598
|
-
const narrowedType = this._evaluator.narrowConstrainedTypeVar(node, typeVar);
|
598
|
+
if (types_1.TypeVarType.hasConstraints(typeVar)) {
|
599
|
+
const narrowedType = this._evaluator.narrowConstrainedTypeVar(node, types_1.TypeVarType.cloneAsBound(typeVar));
|
599
600
|
if (narrowedType) {
|
600
|
-
|
601
|
-
typeVarContext.addSolveForScope((0, typeUtils_1.getTypeVarScopeId)(typeVar));
|
601
|
+
constraints.setBounds(typeVar, narrowedType);
|
602
602
|
}
|
603
603
|
}
|
604
604
|
}
|
605
|
-
if (!
|
606
|
-
|
607
|
-
|
608
|
-
if (this._evaluator.assignType(
|
605
|
+
if (!constraints.isEmpty()) {
|
606
|
+
adjReturnType = this._evaluator.solveAndApplyConstraints(declaredReturnType, constraints);
|
607
|
+
adjReturnType = (0, typeUtils_1.makeTypeVarsBound)(adjReturnType, liveScopes);
|
608
|
+
if (this._evaluator.assignType(adjReturnType, returnType, diagAddendum)) {
|
609
609
|
returnTypeMatches = true;
|
610
610
|
}
|
611
611
|
}
|
@@ -763,7 +763,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
763
763
|
return true;
|
764
764
|
}
|
765
765
|
visitAugmentedAssignment(node) {
|
766
|
-
this._evaluator.
|
766
|
+
const typeResult = this._evaluator.getTypeResult(node);
|
767
|
+
this._reportDeprecatedUseForOperation(node.d.destExpr, typeResult);
|
767
768
|
return true;
|
768
769
|
}
|
769
770
|
visitIndex(node) {
|
@@ -832,7 +833,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
832
833
|
this._validateContainmentTypes(node);
|
833
834
|
}
|
834
835
|
}
|
835
|
-
this._evaluator.
|
836
|
+
const typeResult = this._evaluator.getTypeResult(node);
|
837
|
+
this._reportDeprecatedUseForOperation(node.d.leftExpr, typeResult);
|
836
838
|
return true;
|
837
839
|
}
|
838
840
|
visitSlice(node) {
|
@@ -851,7 +853,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
851
853
|
if (node.d.operator === 38 /* OperatorType.Not */) {
|
852
854
|
this._validateConditionalIsBool(node.d.expr);
|
853
855
|
}
|
854
|
-
this._evaluator.
|
856
|
+
const typeResult = this._evaluator.getTypeResult(node);
|
857
|
+
this._reportDeprecatedUseForOperation(node.d.expr, typeResult);
|
855
858
|
return true;
|
856
859
|
}
|
857
860
|
visitTernary(node) {
|
@@ -1164,6 +1167,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1164
1167
|
let isTypeBool = true;
|
1165
1168
|
const diag = new diagnostic_1.DiagnosticAddendum();
|
1166
1169
|
this._evaluator.mapSubtypesExpandTypeVars(operandType, /* options */ undefined, (expandedSubtype) => {
|
1170
|
+
var _a;
|
1167
1171
|
if ((0, types_1.isAnyOrUnknown)(expandedSubtype)) {
|
1168
1172
|
return undefined;
|
1169
1173
|
}
|
@@ -1172,8 +1176,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1172
1176
|
return undefined;
|
1173
1177
|
}
|
1174
1178
|
// Invoke the __bool__ method on the type.
|
1175
|
-
const boolReturnType = this._evaluator.getTypeOfMagicMethodCall(expandedSubtype, '__bool__', [], node,
|
1176
|
-
/* inferenceContext */ undefined);
|
1179
|
+
const boolReturnType = (_a = this._evaluator.getTypeOfMagicMethodCall(expandedSubtype, '__bool__', [], node,
|
1180
|
+
/* inferenceContext */ undefined)) === null || _a === void 0 ? void 0 : _a.type;
|
1177
1181
|
if (!boolReturnType || (0, types_1.isAnyOrUnknown)(boolReturnType)) {
|
1178
1182
|
return undefined;
|
1179
1183
|
}
|
@@ -1213,7 +1217,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1213
1217
|
let isCoroutine = true;
|
1214
1218
|
(0, typeUtils_1.doForEachSubtype)(exprTypeResult.type, (subtype) => {
|
1215
1219
|
subtype = this._evaluator.makeTopLevelTypeVarsConcrete(subtype);
|
1216
|
-
if (!(0, types_1.isFunction)(subtype) && !(0, types_1.
|
1220
|
+
if (!(0, types_1.isFunction)(subtype) && !(0, types_1.isOverloaded)(subtype)) {
|
1217
1221
|
isExprFunction = false;
|
1218
1222
|
}
|
1219
1223
|
if (!(0, types_1.isClassInstance)(subtype) || !types_1.ClassType.isBuiltIn(subtype, 'Coroutine')) {
|
@@ -1406,6 +1410,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1406
1410
|
isPossiblyTrue = true;
|
1407
1411
|
}
|
1408
1412
|
});
|
1413
|
+
(0, typeUtils_1.doForEachSubtype)(rightType, (rightSubtype) => {
|
1414
|
+
if (this._evaluator.assignType(leftType, rightSubtype)) {
|
1415
|
+
isPossiblyTrue = true;
|
1416
|
+
}
|
1417
|
+
});
|
1409
1418
|
if (!isPossiblyTrue) {
|
1410
1419
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportUnnecessaryComparison, getMessage().format({
|
1411
1420
|
leftType: this._evaluator.printType(leftType, { expandTypeAlias: true }),
|
@@ -1457,8 +1466,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1457
1466
|
if ((0, typeUtils_1.isNoneInstance)(leftType) || (0, typeUtils_1.isNoneInstance)(rightType)) {
|
1458
1467
|
return (0, types_1.isTypeSame)(leftType, rightType);
|
1459
1468
|
}
|
1460
|
-
const isLeftCallable = (0, types_1.isFunction)(leftType) || (0, types_1.
|
1461
|
-
const isRightCallable = (0, types_1.isFunction)(rightType) || (0, types_1.
|
1469
|
+
const isLeftCallable = (0, types_1.isFunction)(leftType) || (0, types_1.isOverloaded)(leftType);
|
1470
|
+
const isRightCallable = (0, types_1.isFunction)(rightType) || (0, types_1.isOverloaded)(rightType);
|
1462
1471
|
if (isLeftCallable !== isRightCallable) {
|
1463
1472
|
return false;
|
1464
1473
|
}
|
@@ -1582,13 +1591,13 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1582
1591
|
var _a, _b, _c, _d, _e, _f, _g;
|
1583
1592
|
const nameType = this._evaluator.getType(nameNode);
|
1584
1593
|
``;
|
1585
|
-
if (nameType && (0, types_1.isTypeVar)(nameType) && !
|
1594
|
+
if (nameType && (0, types_1.isTypeVar)(nameType) && !types_1.TypeVarType.isSelf(nameType)) {
|
1586
1595
|
// Does this name refer to a TypeVar that is scoped to this function?
|
1587
1596
|
if (nameType.priv.scopeId === ParseTreeUtils.getScopeIdForNode(node)) {
|
1588
1597
|
// We exempt constrained TypeVars, TypeVars that are type arguments of
|
1589
1598
|
// other types, and ParamSpecs. There are legitimate uses for singleton
|
1590
1599
|
// instances in these particular cases.
|
1591
|
-
let isExempt =
|
1600
|
+
let isExempt = types_1.TypeVarType.hasConstraints(nameType) ||
|
1592
1601
|
nameType.shared.isDefaultExplicit ||
|
1593
1602
|
(exemptBoundTypeVar && subscriptIndex !== undefined) ||
|
1594
1603
|
(0, types_1.isParamSpec)(nameType);
|
@@ -1727,7 +1736,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1727
1736
|
}
|
1728
1737
|
// Skip this check if the function is overloaded because the TypeVar
|
1729
1738
|
// will be solved in terms of the overload signatures.
|
1730
|
-
const skipUnsolvableTypeVarCheck = (0, types_1.
|
1739
|
+
const skipUnsolvableTypeVarCheck = (0, types_1.isOverloaded)(functionTypeResult.decoratedType) &&
|
1731
1740
|
!types_1.FunctionType.isOverloaded(functionTypeResult.functionType);
|
1732
1741
|
if (isUsedInReturnType &&
|
1733
1742
|
usage.paramTypeWithEllipsisUsageCount > 0 &&
|
@@ -1760,9 +1769,18 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1760
1769
|
// Validates that overloads use @staticmethod and @classmethod consistently.
|
1761
1770
|
_validateOverloadAttributeConsistency(node, functionType) {
|
1762
1771
|
var _a, _b, _c, _d, _e, _f;
|
1772
|
+
// Don't bother with the check if it's suppressed.
|
1773
|
+
if (this._fileInfo.diagnosticRuleSet.reportInconsistentOverload === 'none') {
|
1774
|
+
return;
|
1775
|
+
}
|
1763
1776
|
let staticMethodCount = 0;
|
1764
1777
|
let classMethodCount = 0;
|
1765
|
-
|
1778
|
+
const overloads = types_1.OverloadedType.getOverloads(functionType);
|
1779
|
+
if (overloads.length === 0) {
|
1780
|
+
return;
|
1781
|
+
}
|
1782
|
+
let totalMethods = overloads.length;
|
1783
|
+
overloads.forEach((overload) => {
|
1766
1784
|
if (types_1.FunctionType.isStaticMethod(overload)) {
|
1767
1785
|
staticMethodCount++;
|
1768
1786
|
}
|
@@ -1770,19 +1788,33 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1770
1788
|
classMethodCount++;
|
1771
1789
|
}
|
1772
1790
|
});
|
1773
|
-
|
1791
|
+
const impl = types_1.OverloadedType.getImplementation(functionType);
|
1792
|
+
if (impl && (0, types_1.isFunction)(impl)) {
|
1793
|
+
totalMethods += 1;
|
1794
|
+
if (types_1.FunctionType.isStaticMethod(impl)) {
|
1795
|
+
staticMethodCount++;
|
1796
|
+
}
|
1797
|
+
if (types_1.FunctionType.isClassMethod(impl)) {
|
1798
|
+
classMethodCount++;
|
1799
|
+
}
|
1800
|
+
}
|
1801
|
+
if (staticMethodCount > 0 && staticMethodCount < totalMethods) {
|
1774
1802
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadStaticMethodInconsistent().format({
|
1775
1803
|
name: node.d.name.d.value,
|
1776
|
-
}), (_c = (_b = (_a =
|
1804
|
+
}), (_c = (_b = (_a = overloads[0]) === null || _a === void 0 ? void 0 : _a.shared.declaration) === null || _b === void 0 ? void 0 : _b.node.d.name) !== null && _c !== void 0 ? _c : node.d.name);
|
1777
1805
|
}
|
1778
|
-
if (classMethodCount > 0 && classMethodCount <
|
1806
|
+
if (classMethodCount > 0 && classMethodCount < totalMethods) {
|
1779
1807
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadClassMethodInconsistent().format({
|
1780
1808
|
name: node.d.name.d.value,
|
1781
|
-
}), (_f = (_e = (_d =
|
1809
|
+
}), (_f = (_e = (_d = overloads[0]) === null || _d === void 0 ? void 0 : _d.shared.declaration) === null || _e === void 0 ? void 0 : _e.node.d.name) !== null && _f !== void 0 ? _f : node.d.name);
|
1782
1810
|
}
|
1783
1811
|
}
|
1784
1812
|
// Validates that overloads do not overlap with inconsistent return results.
|
1785
1813
|
_validateOverloadConsistency(node, functionType, prevOverloads) {
|
1814
|
+
// Skip the check entirely if it's disabled.
|
1815
|
+
if (this._fileInfo.diagnosticRuleSet.reportOverlappingOverload === 'none') {
|
1816
|
+
return;
|
1817
|
+
}
|
1786
1818
|
for (let i = 0; i < prevOverloads.length; i++) {
|
1787
1819
|
const prevOverload = prevOverloads[i];
|
1788
1820
|
if (this._isOverlappingOverload(functionType, prevOverload, /* partialOverlap */ false)) {
|
@@ -1802,8 +1834,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1802
1834
|
if (prevReturnType &&
|
1803
1835
|
returnType &&
|
1804
1836
|
!this._evaluator.assignType(returnType, prevReturnType,
|
1805
|
-
/* diag */ undefined,
|
1806
|
-
/*
|
1837
|
+
/* diag */ undefined,
|
1838
|
+
/* constraints */ undefined, 0 /* AssignTypeFlags.Default */)) {
|
1807
1839
|
const altNode = this._findNodeForOverload(node, prevOverload);
|
1808
1840
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportOverlappingOverload, localize_1.LocMessage.overloadReturnTypeMismatch().format({
|
1809
1841
|
name: node.d.name.d.value,
|
@@ -1834,6 +1866,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1834
1866
|
return undefined;
|
1835
1867
|
}
|
1836
1868
|
_isOverlappingOverload(functionType, prevOverload, partialOverlap) {
|
1869
|
+
var _a, _b, _c;
|
1837
1870
|
// According to precedent, the __get__ method is special-cased and is
|
1838
1871
|
// exempt from overlapping overload checks. It's not clear why this is
|
1839
1872
|
// the case, but for consistency with other type checkers, we'll honor
|
@@ -1846,32 +1879,57 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
1846
1879
|
if (partialOverlap) {
|
1847
1880
|
flags |= 32 /* AssignTypeFlags.PartialOverloadOverlap */;
|
1848
1881
|
}
|
1882
|
+
const functionNode = (_a = functionType.shared.declaration) === null || _a === void 0 ? void 0 : _a.node;
|
1883
|
+
if (functionNode) {
|
1884
|
+
const liveTypeVars = ParseTreeUtils.getTypeVarScopesForNode(functionNode);
|
1885
|
+
functionType = (0, typeUtils_1.makeTypeVarsBound)(functionType, liveTypeVars);
|
1886
|
+
}
|
1887
|
+
// Use the parent node of the declaration in this case so we don't transform
|
1888
|
+
// function-local type variables into bound type variables.
|
1889
|
+
const prevOverloadNode = (_c = (_b = prevOverload.shared.declaration) === null || _b === void 0 ? void 0 : _b.node) === null || _c === void 0 ? void 0 : _c.parent;
|
1890
|
+
if (prevOverloadNode) {
|
1891
|
+
const liveTypeVars = ParseTreeUtils.getTypeVarScopesForNode(prevOverloadNode);
|
1892
|
+
prevOverload = (0, typeUtils_1.makeTypeVarsBound)(prevOverload, liveTypeVars);
|
1893
|
+
}
|
1849
1894
|
return this._evaluator.assignType(functionType, prevOverload,
|
1850
|
-
/* diag */ undefined,
|
1851
|
-
/*
|
1852
|
-
}
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1895
|
+
/* diag */ undefined,
|
1896
|
+
/* constraints */ undefined, flags);
|
1897
|
+
}
|
1898
|
+
// Determines whether the implementation of an overload is compatible with an
|
1899
|
+
// overload signature. To be compatible, the implementation must accept all
|
1900
|
+
// of the same arguments as the overload and return a type that is consistent
|
1901
|
+
// with the overload's return type.
|
1902
|
+
_validateOverloadImplementation(overload, implementation, diag) {
|
1903
|
+
var _a, _b, _c, _d, _e;
|
1904
|
+
const constraints = new constraintTracker_1.ConstraintTracker();
|
1905
|
+
let implBound = implementation;
|
1906
|
+
let overloadBound = overload;
|
1907
|
+
const implNode = (_b = (_a = implementation.shared.declaration) === null || _a === void 0 ? void 0 : _a.node) === null || _b === void 0 ? void 0 : _b.parent;
|
1908
|
+
if (implNode) {
|
1909
|
+
const liveScopeIds = ParseTreeUtils.getTypeVarScopesForNode(implNode);
|
1910
|
+
implBound = (0, typeUtils_1.makeTypeVarsBound)(implementation, liveScopeIds);
|
1911
|
+
}
|
1912
|
+
const overloadNode = (_c = overload.shared.declaration) === null || _c === void 0 ? void 0 : _c.node;
|
1913
|
+
if (overloadNode) {
|
1914
|
+
const liveScopeIds = ParseTreeUtils.getTypeVarScopesForNode(overloadNode);
|
1915
|
+
overloadBound = (0, typeUtils_1.makeTypeVarsBound)(overload, liveScopeIds);
|
1916
|
+
}
|
1857
1917
|
// First check the parameters to see if they are assignable.
|
1858
|
-
let
|
1859
|
-
2 /* AssignTypeFlags.ReverseTypeVarMatching */ |
|
1860
|
-
512 /* AssignTypeFlags.SkipSelfClsTypeCheck */);
|
1918
|
+
let isConsistent = this._evaluator.assignType(overloadBound, implBound, diag, constraints, 64 /* AssignTypeFlags.SkipReturnTypeCheck */ | 2 /* AssignTypeFlags.Contravariant */ | 512 /* AssignTypeFlags.SkipSelfClsTypeCheck */);
|
1861
1919
|
// Now check the return types.
|
1862
|
-
const overloadReturnType = (
|
1863
|
-
const
|
1920
|
+
const overloadReturnType = this._evaluator.solveAndApplyConstraints((_d = types_1.FunctionType.getEffectiveReturnType(overloadBound)) !== null && _d !== void 0 ? _d : this._evaluator.getFunctionInferredReturnType(overloadBound), constraints);
|
1921
|
+
const implReturnType = this._evaluator.solveAndApplyConstraints((_e = types_1.FunctionType.getEffectiveReturnType(implBound)) !== null && _e !== void 0 ? _e : this._evaluator.getFunctionInferredReturnType(implBound), constraints);
|
1864
1922
|
const returnDiag = new diagnostic_1.DiagnosticAddendum();
|
1865
1923
|
if (!(0, types_1.isNever)(overloadReturnType) &&
|
1866
|
-
!this._evaluator.assignType(
|
1924
|
+
!this._evaluator.assignType(implReturnType, overloadReturnType, returnDiag.createAddendum(), constraints, 0 /* AssignTypeFlags.Default */)) {
|
1867
1925
|
returnDiag.addMessage(localize_1.LocAddendum.functionReturnTypeMismatch().format({
|
1868
1926
|
sourceType: this._evaluator.printType(overloadReturnType),
|
1869
|
-
destType: this._evaluator.printType(
|
1927
|
+
destType: this._evaluator.printType(implReturnType),
|
1870
1928
|
}));
|
1871
1929
|
diag === null || diag === void 0 ? void 0 : diag.addAddendum(returnDiag);
|
1872
|
-
|
1930
|
+
isConsistent = false;
|
1873
1931
|
}
|
1874
|
-
return
|
1932
|
+
return isConsistent;
|
1875
1933
|
}
|
1876
1934
|
_walkStatementsAndReportUnreachable(statements) {
|
1877
1935
|
let reportedUnreachable = false;
|
@@ -2091,16 +2149,16 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
2091
2149
|
return;
|
2092
2150
|
}
|
2093
2151
|
const type = this._evaluator.getEffectiveTypeOfSymbol(symbol);
|
2094
|
-
const
|
2095
|
-
? types_1.
|
2152
|
+
const overloads = (0, types_1.isOverloaded)(type)
|
2153
|
+
? types_1.OverloadedType.getOverloads(type)
|
2096
2154
|
: (0, types_1.isFunction)(type) && types_1.FunctionType.isOverloaded(type)
|
2097
2155
|
? [type]
|
2098
2156
|
: [];
|
2099
2157
|
// If the implementation has no name, it was synthesized probably by a
|
2100
2158
|
// decorator that used a callable with a ParamSpec that captured the
|
2101
2159
|
// overloaded signature. We'll exempt it from this check.
|
2102
|
-
if ((0, types_1.
|
2103
|
-
const overloads = types_1.
|
2160
|
+
if ((0, types_1.isOverloaded)(type)) {
|
2161
|
+
const overloads = types_1.OverloadedType.getOverloads(type);
|
2104
2162
|
if (overloads.length > 0 && overloads[0].shared.name === '') {
|
2105
2163
|
return;
|
2106
2164
|
}
|
@@ -2110,23 +2168,23 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
2110
2168
|
return;
|
2111
2169
|
}
|
2112
2170
|
}
|
2113
|
-
if (
|
2171
|
+
if (overloads.length === 1) {
|
2114
2172
|
// There should never be a single overload.
|
2115
2173
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.singleOverload().format({ name }), primaryDecl.node.d.name);
|
2116
2174
|
}
|
2117
2175
|
// If the file is not a stub and this is the first overload,
|
2118
2176
|
// verify that there is an implementation.
|
2119
|
-
if (this._fileInfo.isStubFile ||
|
2177
|
+
if (this._fileInfo.isStubFile || overloads.length === 0) {
|
2120
2178
|
return;
|
2121
2179
|
}
|
2122
|
-
let
|
2123
|
-
if ((0, types_1.
|
2124
|
-
|
2180
|
+
let implementation;
|
2181
|
+
if ((0, types_1.isOverloaded)(type)) {
|
2182
|
+
implementation = types_1.OverloadedType.getImplementation(type);
|
2125
2183
|
}
|
2126
2184
|
else if ((0, types_1.isFunction)(type) && !types_1.FunctionType.isOverloaded(type)) {
|
2127
|
-
|
2185
|
+
implementation = type;
|
2128
2186
|
}
|
2129
|
-
if (!
|
2187
|
+
if (!implementation) {
|
2130
2188
|
const containingClassNode = ParseTreeUtils.getEnclosingClassOrFunction(primaryDecl.node);
|
2131
2189
|
if (containingClassNode && containingClassNode.nodeType === 10 /* ParseNodeType.Class */) {
|
2132
2190
|
const classType = this._evaluator.getTypeOfClass(containingClassNode);
|
@@ -2135,8 +2193,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
2135
2193
|
return;
|
2136
2194
|
}
|
2137
2195
|
if (types_1.ClassType.supportsAbstractMethods(classType.classType)) {
|
2138
|
-
if ((0, types_1.
|
2139
|
-
types_1.
|
2196
|
+
if ((0, types_1.isOverloaded)(type) &&
|
2197
|
+
types_1.OverloadedType.getOverloads(type).every((overload) => types_1.FunctionType.isAbstractMethod(overload))) {
|
2140
2198
|
return;
|
2141
2199
|
}
|
2142
2200
|
}
|
@@ -2149,19 +2207,24 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
2149
2207
|
}), primaryDecl.node.d.name);
|
2150
2208
|
return;
|
2151
2209
|
}
|
2152
|
-
if (!(0, types_1.
|
2210
|
+
if (!(0, types_1.isOverloaded)(type)) {
|
2211
|
+
return;
|
2212
|
+
}
|
2213
|
+
if (this._fileInfo.diagnosticRuleSet.reportInconsistentOverload === 'none') {
|
2153
2214
|
return;
|
2154
2215
|
}
|
2155
2216
|
// Verify that all overload signatures are assignable to implementation signature.
|
2156
|
-
types_1.
|
2217
|
+
types_1.OverloadedType.getOverloads(type).forEach((overload, index) => {
|
2157
2218
|
var _a, _b, _c, _d;
|
2158
2219
|
const diag = new diagnostic_1.DiagnosticAddendum();
|
2159
|
-
if (
|
2160
|
-
|
2220
|
+
if (implementation &&
|
2221
|
+
(0, types_1.isFunction)(implementation) &&
|
2222
|
+
!this._validateOverloadImplementation(overload, implementation, diag)) {
|
2223
|
+
if (implementation.shared.declaration) {
|
2161
2224
|
const diagnostic = this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadImplementationMismatch().format({
|
2162
2225
|
name,
|
2163
2226
|
index: index + 1,
|
2164
|
-
}) + diag.getString(),
|
2227
|
+
}) + diag.getString(), implementation.shared.declaration.node.d.name);
|
2165
2228
|
if (diagnostic && overload.shared.declaration) {
|
2166
2229
|
diagnostic.addRelatedInfo(localize_1.LocAddendum.overloadSignature(), (_b = (_a = overload.shared.declaration) === null || _a === void 0 ? void 0 : _a.uri) !== null && _b !== void 0 ? _b : primaryDecl.uri, (_d = (_c = overload.shared.declaration) === null || _c === void 0 ? void 0 : _c.range) !== null && _d !== void 0 ? _d : primaryDecl.range);
|
2167
2230
|
}
|
@@ -2994,6 +3057,16 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
2994
3057
|
this._reportDeprecatedDiagnostic(node, errorMessage, info.deprecatedMessage);
|
2995
3058
|
}
|
2996
3059
|
}
|
3060
|
+
_reportDeprecatedUseForOperation(node, typeResult) {
|
3061
|
+
const deprecationInfo = typeResult === null || typeResult === void 0 ? void 0 : typeResult.magicMethodDeprecationInfo;
|
3062
|
+
if (!deprecationInfo) {
|
3063
|
+
return;
|
3064
|
+
}
|
3065
|
+
this._reportDeprecatedDiagnostic(node, localize_1.LocMessage.deprecatedMethod().format({
|
3066
|
+
className: deprecationInfo.className,
|
3067
|
+
name: deprecationInfo.methodName,
|
3068
|
+
}), deprecationInfo.deprecatedMessage);
|
3069
|
+
}
|
2997
3070
|
_reportDeprecatedUseForType(node, type, isImportFromTyping = false) {
|
2998
3071
|
var _a, _b, _c;
|
2999
3072
|
if (!type) {
|
@@ -3042,7 +3115,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
3042
3115
|
deprecatedMessage = overload.shared.deprecatedMessage;
|
3043
3116
|
errorMessage = getDeprecatedMessageForFunction(overload);
|
3044
3117
|
}
|
3045
|
-
else if ((0, types_1.isInstantiableClass)(type) &&
|
3118
|
+
else if ((0, types_1.isInstantiableClass)(type) &&
|
3119
|
+
['__init__', '__new__'].includes(overload.shared.name)) {
|
3046
3120
|
deprecatedMessage = overload.shared.deprecatedMessage;
|
3047
3121
|
errorMessage = localize_1.LocMessage.deprecatedConstructor().format({
|
3048
3122
|
name: type.shared.name,
|
@@ -3080,7 +3154,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
3080
3154
|
}
|
3081
3155
|
}
|
3082
3156
|
}
|
3083
|
-
else if ((0, types_1.
|
3157
|
+
else if ((0, types_1.isOverloaded)(subtype)) {
|
3084
3158
|
// Determine if the node is part of a call expression. If so,
|
3085
3159
|
// we can determine which overload(s) were used to satisfy
|
3086
3160
|
// the call expression and determine whether any of them
|
@@ -3088,11 +3162,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
3088
3162
|
getDeprecatedMessageForOverloadedCall(this._evaluator, subtype);
|
3089
3163
|
// If there the implementation itself is deprecated, assume it
|
3090
3164
|
// is deprecated even if it's outside of a call expression.
|
3091
|
-
const
|
3092
|
-
if (
|
3093
|
-
if (!
|
3094
|
-
deprecatedMessage =
|
3095
|
-
errorMessage = getDeprecatedMessageForFunction(
|
3165
|
+
const impl = types_1.OverloadedType.getImplementation(subtype);
|
3166
|
+
if (impl && (0, types_1.isFunction)(impl) && impl.shared.deprecatedMessage !== undefined) {
|
3167
|
+
if (!impl.shared.name || node.d.value === impl.shared.name) {
|
3168
|
+
deprecatedMessage = impl.shared.deprecatedMessage;
|
3169
|
+
errorMessage = getDeprecatedMessageForFunction(impl);
|
3096
3170
|
}
|
3097
3171
|
}
|
3098
3172
|
}
|
@@ -3390,13 +3464,14 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
3390
3464
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.typeGuardParamCount(), node.d.name);
|
3391
3465
|
}
|
3392
3466
|
if (isTypeIs) {
|
3393
|
-
const
|
3467
|
+
const scopeIds = (0, typeUtils_1.getTypeVarScopeIds)(functionType);
|
3468
|
+
const typeGuardType = (0, typeUtils_1.makeTypeVarsBound)(returnType.priv.typeArgs[0], scopeIds);
|
3394
3469
|
// Determine the type of the first parameter.
|
3395
3470
|
const paramIndex = isMethod && !types_1.FunctionType.isStaticMethod(functionType) ? 1 : 0;
|
3396
3471
|
if (paramIndex >= functionType.shared.parameters.length) {
|
3397
3472
|
return;
|
3398
3473
|
}
|
3399
|
-
const paramType = types_1.FunctionType.
|
3474
|
+
const paramType = (0, typeUtils_1.makeTypeVarsBound)(types_1.FunctionType.getParamType(functionType, paramIndex), scopeIds);
|
3400
3475
|
// Verify that the typeGuardType is a narrower type than the paramType.
|
3401
3476
|
if (!this._evaluator.assignType(paramType, typeGuardType)) {
|
3402
3477
|
const returnAnnotation = node.d.returnAnnotation || ((_a = node.d.funcAnnotationComment) === null || _a === void 0 ? void 0 : _a.d.returnAnnotation);
|
@@ -3446,6 +3521,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
3446
3521
|
if (declaredReturnType) {
|
3447
3522
|
this._reportUnknownReturnResult(node, declaredReturnType);
|
3448
3523
|
this._validateReturnTypeIsNotContravariant(declaredReturnType, returnAnnotation);
|
3524
|
+
const liveScopes = ParseTreeUtils.getTypeVarScopesForNode(node);
|
3525
|
+
declaredReturnType = (0, typeUtils_1.makeTypeVarsBound)(declaredReturnType, liveScopes);
|
3449
3526
|
}
|
3450
3527
|
// Wrap the declared type in a generator type if the function is a generator.
|
3451
3528
|
if (types_1.FunctionType.isGenerator(functionType)) {
|
@@ -3466,18 +3543,19 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
3466
3543
|
}
|
3467
3544
|
}
|
3468
3545
|
else if (!types_1.FunctionType.isAbstractMethod(functionType)) {
|
3546
|
+
// If the function consists entirely of "...", assume that it's
|
3547
|
+
// an abstract method or a protocol method and don't require that
|
3548
|
+
// the return type matches. This check can also be skipped for an overload.
|
3549
|
+
const isEmptySuite = ParseTreeUtils.isSuiteEmpty(node.d.suite) || types_1.FunctionType.isOverloaded(functionType);
|
3469
3550
|
// Make sure that the function doesn't implicitly return None if the declared
|
3470
3551
|
// type doesn't allow it. Skip this check for abstract methods.
|
3471
|
-
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
3552
|
+
const diagAddendum = isEmptySuite ? undefined : new diagnostic_1.DiagnosticAddendum();
|
3472
3553
|
// If the declared type isn't compatible with 'None', flag an error.
|
3473
3554
|
if (!this._evaluator.assignType(declaredReturnType, this._evaluator.getNoneType(), diagAddendum)) {
|
3474
|
-
|
3475
|
-
// an abstract method or a protocol method and don't require that
|
3476
|
-
// the return type matches. This check can also be skipped for an overload.
|
3477
|
-
if (!ParseTreeUtils.isSuiteEmpty(node.d.suite) && !types_1.FunctionType.isOverloaded(functionType)) {
|
3555
|
+
if (!isEmptySuite) {
|
3478
3556
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportReturnType, localize_1.LocMessage.returnMissing().format({
|
3479
3557
|
returnType: this._evaluator.printType(declaredReturnType),
|
3480
|
-
}) + diagAddendum.getString(), returnAnnotation);
|
3558
|
+
}) + (diagAddendum === null || diagAddendum === void 0 ? void 0 : diagAddendum.getString()), returnAnnotation);
|
3481
3559
|
}
|
3482
3560
|
}
|
3483
3561
|
}
|
@@ -3623,13 +3701,13 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
3623
3701
|
];
|
3624
3702
|
if (newMemberTypeResult) {
|
3625
3703
|
this._evaluator.validateCallArgs(errorNode, argList, newMemberTypeResult,
|
3626
|
-
/*
|
3704
|
+
/* constraints */ undefined,
|
3627
3705
|
/* skipUnknownArgCheck */ undefined,
|
3628
3706
|
/* inferenceContext */ undefined);
|
3629
3707
|
}
|
3630
3708
|
if (initMemberTypeResult) {
|
3631
3709
|
this._evaluator.validateCallArgs(errorNode, argList, initMemberTypeResult,
|
3632
|
-
/*
|
3710
|
+
/* constraints */ undefined,
|
3633
3711
|
/* skipUnknownArgCheck */ undefined,
|
3634
3712
|
/* inferenceContext */ undefined);
|
3635
3713
|
}
|
@@ -3688,7 +3766,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
3688
3766
|
return;
|
3689
3767
|
}
|
3690
3768
|
// Verify that the parameter count matches.
|
3691
|
-
const nonDefaultParams = paramListDetails.params.filter((paramInfo) =>
|
3769
|
+
const nonDefaultParams = paramListDetails.params.filter((paramInfo, index) => types_1.FunctionType.getParamDefaultType(postInitType, index) === undefined);
|
3692
3770
|
// We expect to see one param for "self" plus one for each of the InitVars.
|
3693
3771
|
const expectedParamCount = initOnlySymbolMap.size + 1;
|
3694
3772
|
const postInitNode = postInitType.shared.declaration.node;
|
@@ -3707,7 +3785,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
3707
3785
|
const annotationNode = (_a = paramNode === null || paramNode === void 0 ? void 0 : paramNode.d.annotation) !== null && _a !== void 0 ? _a : paramNode === null || paramNode === void 0 ? void 0 : paramNode.d.annotationComment;
|
3708
3786
|
if (types_1.FunctionParam.isTypeDeclared(param) && annotationNode) {
|
3709
3787
|
const fieldType = (_b = this._evaluator.getDeclaredTypeOfSymbol(symbol)) === null || _b === void 0 ? void 0 : _b.type;
|
3710
|
-
const paramType = types_1.FunctionType.
|
3788
|
+
const paramType = types_1.FunctionType.getParamType(postInitType, paramListDetails.params[paramIndex].index);
|
3711
3789
|
const assignTypeDiag = new diagnostic_1.DiagnosticAddendum();
|
3712
3790
|
if (fieldType && !this._evaluator.assignType(paramType, fieldType, assignTypeDiag)) {
|
3713
3791
|
const diagnostic = this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.dataClassPostInitType().format({ fieldName }) + assignTypeDiag.getString(), annotationNode);
|
@@ -3890,7 +3968,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
3890
3968
|
const objectObject = types_1.ClassType.cloneAsInstance(objectType);
|
3891
3969
|
const dummyTypeObject = types_1.ClassType.createInstantiable('__varianceDummy', '', '', uri_1.Uri.empty(), 0, 0, undefined, undefined);
|
3892
3970
|
classType.shared.typeParams.forEach((param, paramIndex) => {
|
3893
|
-
// Skip
|
3971
|
+
// Skip TypeVarTuples and ParamSpecs.
|
3894
3972
|
if ((0, types_1.isTypeVarTuple)(param) || (0, types_1.isParamSpec)(param)) {
|
3895
3973
|
return;
|
3896
3974
|
}
|
@@ -4007,24 +4085,24 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4007
4085
|
return;
|
4008
4086
|
}
|
4009
4087
|
let newMemberType = newMethodResult.type;
|
4010
|
-
if (!(0, types_1.isFunction)(newMemberType) && !(0, types_1.
|
4088
|
+
if (!(0, types_1.isFunction)(newMemberType) && !(0, types_1.isOverloaded)(newMemberType)) {
|
4011
4089
|
return;
|
4012
4090
|
}
|
4013
|
-
if ((0, types_1.
|
4091
|
+
if ((0, types_1.isOverloaded)(newMemberType)) {
|
4014
4092
|
// Find the implementation, not the overloaded signatures.
|
4015
|
-
newMemberType = types_1.
|
4016
|
-
if (!newMemberType) {
|
4093
|
+
newMemberType = types_1.OverloadedType.getImplementation(newMemberType);
|
4094
|
+
if (!newMemberType || !(0, types_1.isFunction)(newMemberType)) {
|
4017
4095
|
return;
|
4018
4096
|
}
|
4019
4097
|
}
|
4020
4098
|
let initMemberType = initMethodResult.type;
|
4021
|
-
if (!(0, types_1.isFunction)(initMemberType) && !(0, types_1.
|
4099
|
+
if (!(0, types_1.isFunction)(initMemberType) && !(0, types_1.isOverloaded)(initMemberType)) {
|
4022
4100
|
return;
|
4023
4101
|
}
|
4024
|
-
if ((0, types_1.
|
4102
|
+
if ((0, types_1.isOverloaded)(initMemberType)) {
|
4025
4103
|
// Find the implementation, not the overloaded signatures.
|
4026
|
-
initMemberType = types_1.
|
4027
|
-
if (!initMemberType) {
|
4104
|
+
initMemberType = types_1.OverloadedType.getImplementation(initMemberType);
|
4105
|
+
if (!initMemberType || !(0, types_1.isFunction)(initMemberType)) {
|
4028
4106
|
return;
|
4029
4107
|
}
|
4030
4108
|
}
|
@@ -4035,12 +4113,10 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4035
4113
|
}
|
4036
4114
|
if (!this._evaluator.assignType(newMemberType, initMemberType,
|
4037
4115
|
/* diag */ undefined,
|
4038
|
-
/*
|
4039
|
-
/* srcTypeVarContext */ undefined, 64 /* AssignTypeFlags.SkipReturnTypeCheck */) ||
|
4116
|
+
/* constraints */ undefined, 64 /* AssignTypeFlags.SkipReturnTypeCheck */) ||
|
4040
4117
|
!this._evaluator.assignType(initMemberType, newMemberType,
|
4041
4118
|
/* diag */ undefined,
|
4042
|
-
/*
|
4043
|
-
/* srcTypeVarContext */ undefined, 64 /* AssignTypeFlags.SkipReturnTypeCheck */)) {
|
4119
|
+
/* constraints */ undefined, 64 /* AssignTypeFlags.SkipReturnTypeCheck */)) {
|
4044
4120
|
const displayOnInit = types_1.ClassType.isSameGenericClass(initMethodResult.classType, classType);
|
4045
4121
|
const initDecl = initMemberType.shared.declaration;
|
4046
4122
|
const newDecl = newMemberType.shared.declaration;
|
@@ -4087,16 +4163,17 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4087
4163
|
}
|
4088
4164
|
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
4089
4165
|
for (const baseClass of filteredBaseClasses) {
|
4090
|
-
const
|
4166
|
+
const solution = (0, typeUtils_1.buildSolutionFromSpecializedClass)(baseClass);
|
4091
4167
|
for (const baseClassMroClass of baseClass.shared.mro) {
|
4092
4168
|
// There's no need to check for conflicts if this class isn't generic.
|
4093
4169
|
if ((0, types_1.isClass)(baseClassMroClass) && baseClassMroClass.shared.typeParams.length > 0) {
|
4094
|
-
const specializedBaseClassMroClass = (0, typeUtils_1.applySolvedTypeVars)(baseClassMroClass,
|
4170
|
+
const specializedBaseClassMroClass = (0, typeUtils_1.applySolvedTypeVars)(baseClassMroClass, solution);
|
4095
4171
|
// Find the corresponding class in the derived class's MRO list.
|
4096
4172
|
const matchingMroClass = classType.shared.mro.find((mroClass) => (0, types_1.isClass)(mroClass) && types_1.ClassType.isSameGenericClass(mroClass, specializedBaseClassMroClass));
|
4097
4173
|
if (matchingMroClass && (0, types_1.isInstantiableClass)(matchingMroClass)) {
|
4098
|
-
const
|
4099
|
-
const
|
4174
|
+
const scopeIds = (0, typeUtils_1.getTypeVarScopeIds)(classType);
|
4175
|
+
const matchingMroObject = (0, typeUtils_1.makeTypeVarsBound)(types_1.ClassType.cloneAsInstance(matchingMroClass), scopeIds);
|
4176
|
+
const baseClassMroObject = (0, typeUtils_1.makeTypeVarsBound)(types_1.ClassType.cloneAsInstance(specializedBaseClassMroClass), scopeIds);
|
4100
4177
|
if (!this._evaluator.assignType(matchingMroObject, baseClassMroObject)) {
|
4101
4178
|
const diag = new diagnostic_1.DiagnosticAddendum();
|
4102
4179
|
const baseClassObject = (0, typeUtils_1.convertToInstance)(baseClass);
|
@@ -4208,19 +4285,20 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4208
4285
|
let diag;
|
4209
4286
|
const overrideDecl = (0, symbolUtils_1.getLastTypedDeclarationForSymbol)(overrideClassAndSymbol.symbol);
|
4210
4287
|
const overriddenDecl = (0, symbolUtils_1.getLastTypedDeclarationForSymbol)(overriddenClassAndSymbol.symbol);
|
4211
|
-
if ((0, types_1.isFunction)(overriddenType) || (0, types_1.
|
4288
|
+
if ((0, types_1.isFunction)(overriddenType) || (0, types_1.isOverloaded)(overriddenType)) {
|
4212
4289
|
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
4213
4290
|
let overrideFunction;
|
4214
4291
|
if ((0, types_1.isFunction)(overrideType)) {
|
4215
4292
|
overrideFunction = overrideType;
|
4216
4293
|
}
|
4217
|
-
else if ((0, types_1.
|
4294
|
+
else if ((0, types_1.isOverloaded)(overrideType)) {
|
4218
4295
|
// Use the last overload.
|
4219
|
-
|
4296
|
+
const impl = types_1.OverloadedType.getImplementation(overrideType);
|
4220
4297
|
// If the last overload isn't an implementation, skip the check for this symbol.
|
4221
|
-
if (!
|
4298
|
+
if (!impl || !(0, types_1.isFunction)(impl)) {
|
4222
4299
|
return;
|
4223
4300
|
}
|
4301
|
+
overrideFunction = impl;
|
4224
4302
|
}
|
4225
4303
|
if (overrideFunction) {
|
4226
4304
|
if (!this._evaluator.validateOverrideMethod(overriddenType, overrideFunction,
|
@@ -4281,8 +4359,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4281
4359
|
}
|
4282
4360
|
if (!this._evaluator.assignType(overriddenType, childOverrideType !== null && childOverrideType !== void 0 ? childOverrideType : overrideType,
|
4283
4361
|
/* diag */ undefined,
|
4284
|
-
/*
|
4285
|
-
/* srcTypeVarContext */ undefined, isInvariant ? 1 /* AssignTypeFlags.EnforceInvariance */ : 0 /* AssignTypeFlags.Default */)) {
|
4362
|
+
/* constraints */ undefined, isInvariant ? 1 /* AssignTypeFlags.Invariant */ : 0 /* AssignTypeFlags.Default */)) {
|
4286
4363
|
diag = this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportIncompatibleVariableOverride, localize_1.LocMessage.baseClassVariableTypeIncompatible().format({
|
4287
4364
|
classType: childClassType.shared.name,
|
4288
4365
|
name: memberName,
|
@@ -4396,40 +4473,78 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4396
4473
|
return;
|
4397
4474
|
}
|
4398
4475
|
const typeOfSymbol = this._evaluator.getEffectiveTypeOfSymbol(symbol);
|
4399
|
-
if (!(0, types_1.
|
4476
|
+
if (!(0, types_1.isOverloaded)(typeOfSymbol)) {
|
4400
4477
|
return;
|
4401
4478
|
}
|
4402
|
-
const overloads = types_1.
|
4403
|
-
|
4404
|
-
|
4405
|
-
|
4406
|
-
|
4407
|
-
|
4408
|
-
|
4409
|
-
|
4410
|
-
|
4411
|
-
|
4412
|
-
|
4413
|
-
|
4414
|
-
name: overload.shared.name,
|
4415
|
-
}), (_b = (0, declarationUtils_1.getNameNodeForDeclaration)(overload.shared.declaration)) !== null && _b !== void 0 ? _b : overload.shared.declaration.node);
|
4416
|
-
}
|
4417
|
-
});
|
4418
|
-
}
|
4479
|
+
const overloads = types_1.OverloadedType.getOverloads(typeOfSymbol);
|
4480
|
+
const implementation = types_1.OverloadedType.getImplementation(typeOfSymbol);
|
4481
|
+
this._validateOverloadFinalConsistency(overloads, implementation);
|
4482
|
+
this._validateOverloadAbstractConsistency(overloads, implementation);
|
4483
|
+
});
|
4484
|
+
}
|
4485
|
+
_validateOverloadAbstractConsistency(overloads, implementation) {
|
4486
|
+
// If there's an implementation, it will determine whether the
|
4487
|
+
// function is abstract.
|
4488
|
+
if (implementation && (0, types_1.isFunction)(implementation)) {
|
4489
|
+
const isImplAbstract = types_1.FunctionType.isAbstractMethod(implementation);
|
4490
|
+
if (isImplAbstract) {
|
4419
4491
|
return;
|
4420
4492
|
}
|
4421
|
-
|
4422
|
-
|
4493
|
+
overloads.forEach((overload) => {
|
4494
|
+
var _a;
|
4495
|
+
const decl = overload.shared.declaration;
|
4496
|
+
if (types_1.FunctionType.isAbstractMethod(overload) && decl) {
|
4497
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadAbstractImplMismatch().format({
|
4498
|
+
name: overload.shared.name,
|
4499
|
+
}), (_a = (0, declarationUtils_1.getNameNodeForDeclaration)(decl)) !== null && _a !== void 0 ? _a : decl.node);
|
4500
|
+
}
|
4501
|
+
});
|
4502
|
+
return;
|
4503
|
+
}
|
4504
|
+
if (overloads.length < 2) {
|
4505
|
+
return;
|
4506
|
+
}
|
4507
|
+
// If there was no implementation, make sure all overloads are either
|
4508
|
+
// abstract or not abstract.
|
4509
|
+
const isFirstOverloadAbstract = types_1.FunctionType.isAbstractMethod(overloads[0]);
|
4510
|
+
overloads.slice(1).forEach((overload, index) => {
|
4511
|
+
var _a;
|
4512
|
+
if (types_1.FunctionType.isAbstractMethod(overload) !== isFirstOverloadAbstract && overload.shared.declaration) {
|
4513
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadAbstractMismatch().format({
|
4514
|
+
name: overload.shared.name,
|
4515
|
+
}), (_a = (0, declarationUtils_1.getNameNodeForDeclaration)(overload.shared.declaration)) !== null && _a !== void 0 ? _a : overload.shared.declaration.node);
|
4516
|
+
}
|
4517
|
+
});
|
4518
|
+
}
|
4519
|
+
_validateOverloadFinalConsistency(overloads, implementation) {
|
4520
|
+
// If there's an implementation, it will determine whether the
|
4521
|
+
// function is @final.
|
4522
|
+
if (implementation && (0, types_1.isFunction)(implementation)) {
|
4523
|
+
// If one or more of the overloads is marked @final but the
|
4524
|
+
// implementation is not, report an error.
|
4525
|
+
if (!types_1.FunctionType.isFinal(implementation)) {
|
4526
|
+
overloads.forEach((overload) => {
|
4423
4527
|
var _a, _b;
|
4424
4528
|
if (types_1.FunctionType.isFinal(overload) && ((_a = overload.shared.declaration) === null || _a === void 0 ? void 0 : _a.node)) {
|
4425
|
-
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.
|
4529
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadFinalInconsistencyImpl().format({
|
4426
4530
|
name: overload.shared.name,
|
4427
|
-
index: index + 2,
|
4428
4531
|
}), (_b = (0, declarationUtils_1.getNameNodeForDeclaration)(overload.shared.declaration)) !== null && _b !== void 0 ? _b : overload.shared.declaration.node);
|
4429
4532
|
}
|
4430
4533
|
});
|
4431
4534
|
}
|
4432
|
-
|
4535
|
+
return;
|
4536
|
+
}
|
4537
|
+
if (overloads.length > 0 && !types_1.FunctionType.isFinal(overloads[0])) {
|
4538
|
+
overloads.slice(1).forEach((overload, index) => {
|
4539
|
+
var _a, _b;
|
4540
|
+
if (types_1.FunctionType.isFinal(overload) && ((_a = overload.shared.declaration) === null || _a === void 0 ? void 0 : _a.node)) {
|
4541
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInconsistentOverload, localize_1.LocMessage.overloadFinalInconsistencyNoImpl().format({
|
4542
|
+
name: overload.shared.name,
|
4543
|
+
index: index + 2,
|
4544
|
+
}), (_b = (0, declarationUtils_1.getNameNodeForDeclaration)(overload.shared.declaration)) !== null && _b !== void 0 ? _b : overload.shared.declaration.node);
|
4545
|
+
}
|
4546
|
+
});
|
4547
|
+
}
|
4433
4548
|
}
|
4434
4549
|
// For a TypedDict class that derives from another TypedDict class
|
4435
4550
|
// that is closed, verify that any new keys are compatible with the
|
@@ -4448,9 +4563,9 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4448
4563
|
}
|
4449
4564
|
const baseTypedDictEntries = (0, typedDicts_1.getTypedDictMembersForClass)(this._evaluator, baseClass,
|
4450
4565
|
/* allowNarrowed */ false);
|
4451
|
-
const
|
4566
|
+
const solution = (0, typeUtils_1.buildSolutionFromSpecializedClass)(baseClass);
|
4452
4567
|
const baseExtraItemsType = baseTypedDictEntries.extraItems
|
4453
|
-
? (0, typeUtils_1.applySolvedTypeVars)(baseTypedDictEntries.extraItems.valueType,
|
4568
|
+
? (0, typeUtils_1.applySolvedTypeVars)(baseTypedDictEntries.extraItems.valueType, solution)
|
4454
4569
|
: types_1.UnknownType.create();
|
4455
4570
|
for (const [name, entry] of typedDictEntries.knownItems) {
|
4456
4571
|
const baseEntry = baseTypedDictEntries.knownItems.get(name);
|
@@ -4462,9 +4577,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4462
4577
|
}
|
4463
4578
|
else if (!this._evaluator.assignType(baseExtraItemsType, entry.valueType,
|
4464
4579
|
/* diag */ undefined,
|
4465
|
-
/*
|
4466
|
-
|
4467
|
-
? 1 /* AssignTypeFlags.EnforceInvariance */
|
4580
|
+
/* constraints */ undefined, !baseTypedDictEntries.extraItems.isReadOnly
|
4581
|
+
? 1 /* AssignTypeFlags.Invariant */
|
4468
4582
|
: 0 /* AssignTypeFlags.Default */)) {
|
4469
4583
|
diag.addMessage(localize_1.LocAddendum.typedDictClosedExtraTypeMismatch().format({
|
4470
4584
|
name,
|
@@ -4481,9 +4595,8 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4481
4595
|
if (typedDictEntries.extraItems && baseTypedDictEntries.extraItems) {
|
4482
4596
|
if (!this._evaluator.assignType(baseExtraItemsType, typedDictEntries.extraItems.valueType,
|
4483
4597
|
/* diag */ undefined,
|
4484
|
-
/*
|
4485
|
-
|
4486
|
-
? 1 /* AssignTypeFlags.EnforceInvariance */
|
4598
|
+
/* constraints */ undefined, !baseTypedDictEntries.extraItems.isReadOnly
|
4599
|
+
? 1 /* AssignTypeFlags.Invariant */
|
4487
4600
|
: 0 /* AssignTypeFlags.Default */)) {
|
4488
4601
|
diag.addMessage(localize_1.LocAddendum.typedDictClosedExtraTypeMismatch().format({
|
4489
4602
|
name: '__extra_items__',
|
@@ -4571,8 +4684,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4571
4684
|
if ((0, types_1.isFunction)(overrideType)) {
|
4572
4685
|
overrideFunction = overrideType;
|
4573
4686
|
}
|
4574
|
-
else if ((0, types_1.
|
4575
|
-
|
4687
|
+
else if ((0, types_1.isOverloaded)(overrideType)) {
|
4688
|
+
const impl = types_1.OverloadedType.getImplementation(overrideType);
|
4689
|
+
if (impl && (0, types_1.isFunction)(impl)) {
|
4690
|
+
overrideFunction = impl;
|
4691
|
+
}
|
4576
4692
|
}
|
4577
4693
|
else if ((0, types_1.isClassInstance)(overrideType) && types_1.ClassType.isPropertyClass(overrideType)) {
|
4578
4694
|
if (overrideType.priv.fgetInfo) {
|
@@ -4614,8 +4730,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4614
4730
|
if ((0, types_1.isFunction)(overrideType)) {
|
4615
4731
|
overrideFunction = overrideType;
|
4616
4732
|
}
|
4617
|
-
else if ((0, types_1.
|
4618
|
-
|
4733
|
+
else if ((0, types_1.isOverloaded)(overrideType)) {
|
4734
|
+
const impl = types_1.OverloadedType.getImplementation(overrideType);
|
4735
|
+
if (impl && (0, types_1.isFunction)(impl)) {
|
4736
|
+
overrideFunction = impl;
|
4737
|
+
}
|
4619
4738
|
}
|
4620
4739
|
else if ((0, types_1.isClassInstance)(overrideType) && types_1.ClassType.isPropertyClass(overrideType)) {
|
4621
4740
|
if (overrideType.priv.fgetInfo) {
|
@@ -4654,9 +4773,13 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4654
4773
|
}
|
4655
4774
|
const baseClass = baseClassAndSymbol.classType;
|
4656
4775
|
const childClassSelf = types_1.ClassType.cloneAsInstance((0, typeUtils_1.selfSpecializeClass)(childClassType));
|
4657
|
-
|
4776
|
+
let baseType = (0, typeUtils_1.partiallySpecializeType)(this._evaluator.getEffectiveTypeOfSymbol(baseClassAndSymbol.symbol), baseClass, this._evaluator.getTypeClassType(), childClassSelf);
|
4658
4777
|
overrideType = (0, typeUtils_1.partiallySpecializeType)(overrideType, childClassType, this._evaluator.getTypeClassType(), childClassSelf);
|
4659
|
-
if (
|
4778
|
+
if (childClassType.shared.typeVarScopeId) {
|
4779
|
+
baseType = (0, typeUtils_1.makeTypeVarsBound)(baseType, [childClassType.shared.typeVarScopeId]);
|
4780
|
+
overrideType = (0, typeUtils_1.makeTypeVarsBound)(overrideType, [childClassType.shared.typeVarScopeId]);
|
4781
|
+
}
|
4782
|
+
if ((0, types_1.isFunction)(baseType) || (0, types_1.isOverloaded)(baseType)) {
|
4660
4783
|
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
4661
4784
|
// Determine whether this is an attempt to override a method marked @final.
|
4662
4785
|
let reportFinalMethodOverride = false;
|
@@ -4665,9 +4788,15 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4665
4788
|
if ((0, types_1.isFunction)(baseType) && types_1.FunctionType.isFinal(baseType)) {
|
4666
4789
|
reportFinalMethodOverride = true;
|
4667
4790
|
}
|
4668
|
-
else if ((0, types_1.
|
4669
|
-
|
4670
|
-
|
4791
|
+
else if ((0, types_1.isOverloaded)(baseType)) {
|
4792
|
+
const overloads = types_1.OverloadedType.getOverloads(baseType);
|
4793
|
+
const impl = types_1.OverloadedType.getImplementation(baseType);
|
4794
|
+
if (overloads.some((overload) => types_1.FunctionType.isFinal(overload))) {
|
4795
|
+
reportFinalMethodOverride = true;
|
4796
|
+
}
|
4797
|
+
if (impl && (0, types_1.isFunction)(impl) && types_1.FunctionType.isFinal(impl)) {
|
4798
|
+
reportFinalMethodOverride = true;
|
4799
|
+
}
|
4671
4800
|
}
|
4672
4801
|
}
|
4673
4802
|
if (reportFinalMethodOverride) {
|
@@ -4683,7 +4812,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4683
4812
|
}
|
4684
4813
|
}
|
4685
4814
|
}
|
4686
|
-
if ((0, types_1.isFunction)(overrideType) || (0, types_1.
|
4815
|
+
if ((0, types_1.isFunction)(overrideType) || (0, types_1.isOverloaded)(overrideType)) {
|
4687
4816
|
// Don't enforce parameter names for dundered methods. Many of them
|
4688
4817
|
// are misnamed in typeshed stubs, so this would result in many
|
4689
4818
|
// false positives.
|
@@ -4794,8 +4923,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4794
4923
|
}
|
4795
4924
|
let diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
4796
4925
|
if (!this._evaluator.assignType(baseType, overrideType, diagAddendum,
|
4797
|
-
/*
|
4798
|
-
/* srcTypeVarContext */ undefined, isInvariant ? 1 /* AssignTypeFlags.EnforceInvariance */ : 0 /* AssignTypeFlags.Default */)) {
|
4926
|
+
/* constraints */ undefined, isInvariant ? 1 /* AssignTypeFlags.Invariant */ : 0 /* AssignTypeFlags.Default */)) {
|
4799
4927
|
if (isInvariant) {
|
4800
4928
|
diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
4801
4929
|
diagAddendum.addMessage(localize_1.LocAddendum.overrideIsInvariant());
|
@@ -4949,104 +5077,93 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4949
5077
|
// Performs checks on a function that is located within a class
|
4950
5078
|
// and has been determined not to be a property accessor.
|
4951
5079
|
_validateMethod(node, functionType, classNode) {
|
4952
|
-
var _a, _b;
|
4953
5080
|
const classTypeInfo = this._evaluator.getTypeOfClass(classNode);
|
4954
|
-
|
4955
|
-
|
4956
|
-
const superCheckMethods = ['__init__', '__init_subclass__', '__enter__', '__exit__'];
|
4957
|
-
if (superCheckMethods.some((name) => name === node.d.name.d.value)) {
|
4958
|
-
if (!types_1.FunctionType.isAbstractMethod(functionType) &&
|
4959
|
-
!types_1.FunctionType.isOverloaded(functionType) &&
|
4960
|
-
!this._fileInfo.isStubFile) {
|
4961
|
-
this._validateSuperCallForMethod(node, functionType, classType);
|
4962
|
-
}
|
4963
|
-
}
|
5081
|
+
if (!classTypeInfo) {
|
5082
|
+
return;
|
4964
5083
|
}
|
4965
|
-
|
4966
|
-
|
4967
|
-
|
4968
|
-
|
4969
|
-
|
4970
|
-
|
4971
|
-
|
4972
|
-
|
4973
|
-
this.
|
5084
|
+
const classType = classTypeInfo.classType;
|
5085
|
+
const methodName = node.d.name.d.value;
|
5086
|
+
const isMetaclass = (0, typeUtils_1.isInstantiableMetaclass)(classType);
|
5087
|
+
const superCheckMethods = ['__init__', '__init_subclass__', '__enter__', '__exit__'];
|
5088
|
+
if (superCheckMethods.includes(methodName)) {
|
5089
|
+
if (!types_1.FunctionType.isAbstractMethod(functionType) &&
|
5090
|
+
!types_1.FunctionType.isOverloaded(functionType) &&
|
5091
|
+
!this._fileInfo.isStubFile) {
|
5092
|
+
this._validateSuperCallForMethod(node, functionType, classType);
|
4974
5093
|
}
|
4975
5094
|
}
|
4976
|
-
|
5095
|
+
const selfNames = ['self', '_self', '__self'];
|
5096
|
+
const clsNames = ['cls', '_cls', '__cls'];
|
5097
|
+
const clsNamesMetaclass = ['__mcls', 'mcls', 'mcs', 'metacls'];
|
5098
|
+
if (methodName === '_generate_next_value_') {
|
4977
5099
|
// Skip this check for _generate_next_value_.
|
5100
|
+
return;
|
4978
5101
|
}
|
4979
|
-
|
4980
|
-
//
|
4981
|
-
if (node.d.params.length
|
5102
|
+
if (methodName === '__new__') {
|
5103
|
+
// __new__ overrides should have a "cls" parameter.
|
5104
|
+
if (node.d.params.length === 0 || !node.d.params[0].d.name) {
|
5105
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.newClsParam(), node.d.name);
|
5106
|
+
}
|
5107
|
+
else {
|
4982
5108
|
const paramName = node.d.params[0].d.name.d.value;
|
4983
|
-
if (paramName
|
4984
|
-
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.
|
5109
|
+
if (!clsNames.includes(paramName) && !(isMetaclass && clsNamesMetaclass.includes(paramName))) {
|
5110
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.newClsParam(), node.d.params[0]);
|
4985
5111
|
}
|
4986
5112
|
}
|
5113
|
+
this._validateClsSelfParamType(node, functionType, classType, /* isCls */ true);
|
5114
|
+
return;
|
5115
|
+
}
|
5116
|
+
if (types_1.FunctionType.isStaticMethod(functionType)) {
|
5117
|
+
if (node.d.params.length === 0 || !node.d.params[0].d.name) {
|
5118
|
+
return;
|
5119
|
+
}
|
5120
|
+
// Static methods should not have "self" or "cls" parameters.
|
5121
|
+
const paramName = node.d.params[0].d.name.d.value;
|
5122
|
+
if (paramName === 'self' || paramName === 'cls') {
|
5123
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.staticClsSelfParam(), node.d.params[0].d.name);
|
5124
|
+
}
|
5125
|
+
return;
|
4987
5126
|
}
|
4988
|
-
|
5127
|
+
if (types_1.FunctionType.isClassMethod(functionType)) {
|
4989
5128
|
let paramName = '';
|
4990
5129
|
if (node.d.params.length > 0 && node.d.params[0].d.name) {
|
4991
5130
|
paramName = node.d.params[0].d.name.d.value;
|
4992
5131
|
}
|
4993
|
-
// Class methods should have a "cls" parameter.
|
4994
|
-
|
4995
|
-
|
4996
|
-
if (paramName !== 'cls') {
|
4997
|
-
if (!this._fileInfo.isStubFile || (!paramName.startsWith('_') && paramName !== 'metacls')) {
|
4998
|
-
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.classMethodClsParam(), node.d.params.length > 0 ? node.d.params[0] : node.d.name);
|
4999
|
-
}
|
5000
|
-
}
|
5001
|
-
if (classType) {
|
5002
|
-
this._validateClsSelfParamType(node, functionType, classType, /* isCls */ true);
|
5132
|
+
// Class methods should have a "cls" parameter.
|
5133
|
+
if (!clsNames.includes(paramName) && !(isMetaclass && clsNamesMetaclass.includes(paramName))) {
|
5134
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.classMethodClsParam(), node.d.params.length > 0 ? node.d.params[0] : node.d.name);
|
5003
5135
|
}
|
5136
|
+
this._validateClsSelfParamType(node, functionType, classType, /* isCls */ true);
|
5137
|
+
return;
|
5004
5138
|
}
|
5005
|
-
|
5006
|
-
|
5007
|
-
|
5008
|
-
|
5009
|
-
|
5010
|
-
|
5011
|
-
|
5012
|
-
|
5013
|
-
|
5014
|
-
if (node.d.params.
|
5015
|
-
|
5016
|
-
paramName = node.d.params[0].d.name.d.value;
|
5017
|
-
}
|
5018
|
-
if (node.d.params[0].d.category !== 0 /* ParamCategory.Simple */) {
|
5019
|
-
firstParamIsSimple = false;
|
5020
|
-
}
|
5139
|
+
const decoratorIsPresent = node.d.decorators.length > 0;
|
5140
|
+
const isOverloaded = types_1.FunctionType.isOverloaded(functionType);
|
5141
|
+
// The presence of a decorator can change the behavior, so we need
|
5142
|
+
// to back off from this check if a decorator is present. An overload
|
5143
|
+
// is a decorator, but we'll ignore that here.
|
5144
|
+
if (isOverloaded || !decoratorIsPresent) {
|
5145
|
+
let paramName = '';
|
5146
|
+
let firstParamIsSimple = true;
|
5147
|
+
if (node.d.params.length > 0) {
|
5148
|
+
if (node.d.params[0].d.name) {
|
5149
|
+
paramName = node.d.params[0].d.name.d.value;
|
5021
5150
|
}
|
5022
|
-
|
5023
|
-
|
5024
|
-
// Special-case metaclasses, which can use "cls" or several variants.
|
5025
|
-
let isLegalMetaclassName = false;
|
5026
|
-
if (['cls', 'mcls', 'mcs'].some((name) => name === paramName)) {
|
5027
|
-
const classTypeInfo = this._evaluator.getTypeOfClass(classNode);
|
5028
|
-
const typeType = this._evaluator.getBuiltInType(classNode, 'type');
|
5029
|
-
if (typeType &&
|
5030
|
-
(0, types_1.isInstantiableClass)(typeType) &&
|
5031
|
-
classTypeInfo &&
|
5032
|
-
(0, types_1.isInstantiableClass)(classTypeInfo.classType)) {
|
5033
|
-
if ((0, typeUtils_1.derivesFromClassRecursive)(classTypeInfo.classType, typeType, /* ignoreUnknown */ true)) {
|
5034
|
-
isLegalMetaclassName = true;
|
5035
|
-
}
|
5036
|
-
}
|
5037
|
-
}
|
5038
|
-
// Some typeshed stubs use a name that starts with an underscore to designate
|
5039
|
-
// a parameter that cannot be positional.
|
5040
|
-
const isPrivateName = SymbolNameUtils.isPrivateOrProtectedName(paramName);
|
5041
|
-
if (!isLegalMetaclassName && !isPrivateName) {
|
5042
|
-
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.instanceMethodSelfParam(), node.d.params.length > 0 ? node.d.params[0] : node.d.name);
|
5043
|
-
}
|
5151
|
+
if (node.d.params[0].d.category !== 0 /* ParamCategory.Simple */) {
|
5152
|
+
firstParamIsSimple = false;
|
5044
5153
|
}
|
5045
5154
|
}
|
5046
|
-
|
5047
|
-
|
5155
|
+
// Instance methods should have a "self" parameter.
|
5156
|
+
if (firstParamIsSimple && !selfNames.includes(paramName)) {
|
5157
|
+
const isLegalMetaclassName = isMetaclass && clsNames.includes(paramName);
|
5158
|
+
// Some typeshed stubs use a name that starts with an underscore to designate
|
5159
|
+
// a parameter that cannot be positional.
|
5160
|
+
const isPrivateName = SymbolNameUtils.isPrivateOrProtectedName(paramName);
|
5161
|
+
if (!isLegalMetaclassName && !isPrivateName) {
|
5162
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportSelfClsParameterName, localize_1.LocMessage.instanceMethodSelfParam(), node.d.params.length > 0 ? node.d.params[0] : node.d.name);
|
5163
|
+
}
|
5048
5164
|
}
|
5049
5165
|
}
|
5166
|
+
this._validateClsSelfParamType(node, functionType, classType, /* isCls */ false);
|
5050
5167
|
}
|
5051
5168
|
// Determines whether the method properly calls through to the same method in all
|
5052
5169
|
// parent classes that expose a same-named method.
|
@@ -5111,6 +5228,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
5111
5228
|
// If there is no type annotation, there's nothing to check because
|
5112
5229
|
// the type will be inferred.d.typeAnnotation
|
5113
5230
|
const paramInfo = functionType.shared.parameters[0];
|
5231
|
+
const paramType = types_1.FunctionType.getParamType(functionType, 0);
|
5114
5232
|
const paramAnnotation = (_a = node.d.params[0].d.annotation) !== null && _a !== void 0 ? _a : node.d.params[0].d.annotationComment;
|
5115
5233
|
if (!paramAnnotation || !paramInfo.name) {
|
5116
5234
|
return;
|
@@ -5119,11 +5237,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
5119
5237
|
// use of class-scoped TypeVars, which are not allowed in this context
|
5120
5238
|
// according to the typing spec.
|
5121
5239
|
if (functionType.shared.name === '__init__' && functionType.shared.methodClass) {
|
5122
|
-
const typeVars = (0, typeUtils_1.getTypeVarArgsRecursive)(
|
5240
|
+
const typeVars = (0, typeUtils_1.getTypeVarArgsRecursive)(paramType);
|
5123
5241
|
if (typeVars.some((typeVar) => {
|
5124
5242
|
var _a;
|
5125
5243
|
return typeVar.priv.scopeId === ((_a = functionType.shared.methodClass) === null || _a === void 0 ? void 0 : _a.shared.typeVarScopeId) &&
|
5126
|
-
!
|
5244
|
+
!types_1.TypeVarType.isSelf(typeVar);
|
5127
5245
|
})) {
|
5128
5246
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportInvalidTypeVarUse, localize_1.LocMessage.initMethodSelfParamTypeVar(), paramAnnotation);
|
5129
5247
|
}
|
@@ -5133,20 +5251,20 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
5133
5251
|
if (types_1.ClassType.isProtocolClass(classType)) {
|
5134
5252
|
return;
|
5135
5253
|
}
|
5136
|
-
const
|
5254
|
+
const concreteParamType = this._evaluator.makeTopLevelTypeVarsConcrete(paramType);
|
5137
5255
|
const expectedType = isCls ? classType : (0, typeUtils_1.convertToInstance)(classType);
|
5138
5256
|
// If the declared type is a protocol class or instance, skip
|
5139
5257
|
// the check. This has legitimate uses for mix-in classes.
|
5140
|
-
if ((0, types_1.isInstantiableClass)(
|
5258
|
+
if ((0, types_1.isInstantiableClass)(concreteParamType) && types_1.ClassType.isProtocolClass(concreteParamType)) {
|
5141
5259
|
return;
|
5142
5260
|
}
|
5143
|
-
if ((0, types_1.isClassInstance)(
|
5261
|
+
if ((0, types_1.isClassInstance)(concreteParamType) && types_1.ClassType.isProtocolClass(concreteParamType)) {
|
5144
5262
|
return;
|
5145
5263
|
}
|
5146
5264
|
// If the method starts with a `*args: P.args`, skip the check.
|
5147
5265
|
if (paramInfo.category === 1 /* ParamCategory.ArgsList */ &&
|
5148
|
-
(0, types_1.isParamSpec)(
|
5149
|
-
|
5266
|
+
(0, types_1.isParamSpec)(paramType) &&
|
5267
|
+
paramType.priv.paramSpecAccess === 'args') {
|
5150
5268
|
return;
|
5151
5269
|
}
|
5152
5270
|
// Don't enforce this for an overloaded method because the "self" param
|
@@ -5163,8 +5281,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
5163
5281
|
types_1.ClassType.isBuiltIn(classType, 'str')) {
|
5164
5282
|
return;
|
5165
5283
|
}
|
5166
|
-
|
5167
|
-
if (!this._evaluator.assignType(paramType, expectedType, /* diag */ undefined, typeVarContext)) {
|
5284
|
+
if (!this._evaluator.assignType(paramType, expectedType)) {
|
5168
5285
|
// We exempt Never from this check because it has a legitimate use in this case.
|
5169
5286
|
if (!(0, types_1.isNever)(paramType)) {
|
5170
5287
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportGeneralTypeIssues, localize_1.LocMessage.clsSelfParamTypeMismatch().format({
|
@@ -5191,7 +5308,7 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
5191
5308
|
return;
|
5192
5309
|
}
|
5193
5310
|
const liveScopes = ParseTreeUtils.getTypeVarScopesForNode(node);
|
5194
|
-
declaredReturnType = (0, typeUtils_1.
|
5311
|
+
declaredReturnType = (0, typeUtils_1.makeTypeVarsBound)(declaredReturnType, liveScopes);
|
5195
5312
|
let generatorType;
|
5196
5313
|
if (!enclosingFunctionNode.d.isAsync &&
|
5197
5314
|
(0, types_1.isClassInstance)(declaredReturnType) &&
|