@zzzen/pyright-internal 1.2.0-dev.20250105 → 1.2.0-dev.20250119
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/checker.js +5 -18
- package/dist/analyzer/checker.js.map +1 -1
- package/dist/analyzer/constructors.js +1 -1
- package/dist/analyzer/constructors.js.map +1 -1
- package/dist/analyzer/importStatementUtils.js +1 -1
- package/dist/analyzer/importStatementUtils.js.map +1 -1
- package/dist/analyzer/parentDirectoryCache.js +1 -1
- package/dist/analyzer/parentDirectoryCache.js.map +1 -1
- package/dist/analyzer/parseTreeUtils.d.ts +2 -1
- package/dist/analyzer/parseTreeUtils.js +22 -15
- package/dist/analyzer/parseTreeUtils.js.map +1 -1
- package/dist/analyzer/typeCacheUtils.js +1 -1
- package/dist/analyzer/typeCacheUtils.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +71 -39
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +3 -1
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
- package/dist/analyzer/typeGuards.js +14 -10
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/common/fullAccessHost.d.ts +1 -1
- package/dist/common/fullAccessHost.js +1 -1
- package/dist/languageService/autoImporter.d.ts +6 -8
- package/dist/languageService/autoImporter.js +23 -16
- package/dist/languageService/autoImporter.js.map +1 -1
- package/dist/languageService/hoverProvider.js +5 -3
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/languageService/tooltipUtils.d.ts +1 -1
- package/dist/languageService/tooltipUtils.js +14 -1
- package/dist/languageService/tooltipUtils.js.map +1 -1
- package/dist/localization/localize.d.ts +6 -0
- package/dist/localization/localize.js +3 -0
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.cs.json +8 -5
- package/dist/localization/package.nls.de.json +8 -5
- package/dist/localization/package.nls.en-us.json +10 -1
- package/dist/localization/package.nls.es.json +8 -5
- package/dist/localization/package.nls.fr.json +8 -5
- package/dist/localization/package.nls.it.json +8 -5
- package/dist/localization/package.nls.ja.json +8 -5
- package/dist/localization/package.nls.ko.json +8 -5
- package/dist/localization/package.nls.pl.json +8 -5
- package/dist/localization/package.nls.pt-br.json +8 -5
- package/dist/localization/package.nls.qps-ploc.json +8 -5
- package/dist/localization/package.nls.ru.json +8 -5
- package/dist/localization/package.nls.tr.json +8 -5
- package/dist/localization/package.nls.zh-cn.json +8 -5
- package/dist/localization/package.nls.zh-tw.json +8 -5
- package/dist/parser/parser.js +13 -3
- package/dist/parser/parser.js.map +1 -1
- package/dist/parser/stringTokenUtils.d.ts +1 -1
- package/dist/parser/stringTokenUtils.js +4 -2
- package/dist/parser/stringTokenUtils.js.map +1 -1
- package/dist/tests/harness/fourslash/testState.js +8 -0
- package/dist/tests/harness/fourslash/testState.js.map +1 -1
- package/dist/tests/hoverProvider.test.js +51 -0
- package/dist/tests/hoverProvider.test.js.map +1 -1
- package/dist/tests/testUtils.d.ts +0 -1
- package/dist/tests/testUtils.js +29 -21
- package/dist/tests/testUtils.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +1 -1
- package/dist/tests/typeEvaluator4.test.js +1 -1
- package/dist/tests/typeEvaluator6.test.js +4 -0
- 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/package.json +5 -5
package/dist/analyzer/checker.js
CHANGED
@@ -4128,25 +4128,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4128
4128
|
const overriddenDecl = (0, symbolUtils_1.getLastTypedDeclarationForSymbol)(overriddenClassAndSymbol.symbol);
|
4129
4129
|
if ((0, types_1.isFunction)(overriddenType) || (0, types_1.isOverloaded)(overriddenType)) {
|
4130
4130
|
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|
4131
|
-
|
4132
|
-
|
4133
|
-
overrideFunction = overrideType;
|
4134
|
-
}
|
4135
|
-
else if ((0, types_1.isOverloaded)(overrideType)) {
|
4136
|
-
// Use the last overload.
|
4137
|
-
const impl = types_1.OverloadedType.getImplementation(overrideType);
|
4138
|
-
// If the last overload isn't an implementation, skip the check for this symbol.
|
4139
|
-
if (!impl || !(0, types_1.isFunction)(impl)) {
|
4140
|
-
return;
|
4141
|
-
}
|
4142
|
-
overrideFunction = impl;
|
4143
|
-
}
|
4144
|
-
if (overrideFunction) {
|
4145
|
-
if (!this._evaluator.validateOverrideMethod(overriddenType, overrideFunction,
|
4131
|
+
if ((0, types_1.isFunction)(overrideType) || (0, types_1.isOverloaded)(overrideType)) {
|
4132
|
+
if (!this._evaluator.validateOverrideMethod(overriddenType, overrideType,
|
4146
4133
|
/* baseClass */ undefined, diagAddendum,
|
4147
4134
|
/* enforceParamNameMatch */ true)) {
|
4148
|
-
|
4149
|
-
if (decl && decl.type === 5 /* DeclarationType.Function */) {
|
4135
|
+
if (overrideDecl && overrideDecl.type === 5 /* DeclarationType.Function */) {
|
4150
4136
|
diag = this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportIncompatibleMethodOverride, localize_1.LocMessage.baseClassMethodTypeIncompatible().format({
|
4151
4137
|
classType: childClassType.shared.name,
|
4152
4138
|
name: memberName,
|
@@ -4613,10 +4599,11 @@ class Checker extends parseTreeWalker_1.ParseTreeWalker {
|
|
4613
4599
|
}
|
4614
4600
|
const baseClass = baseClassAndSymbol.classType;
|
4615
4601
|
const childClassSelf = types_1.ClassType.cloneAsInstance((0, typeUtils_1.selfSpecializeClass)(childClassType, { useBoundTypeVars: true }));
|
4616
|
-
|
4602
|
+
let baseType = (0, typeUtils_1.partiallySpecializeType)(this._evaluator.getEffectiveTypeOfSymbol(baseClassAndSymbol.symbol), baseClass, this._evaluator.getTypeClassType(), childClassSelf);
|
4617
4603
|
overrideType = (0, typeUtils_1.partiallySpecializeType)(overrideType, childClassType, this._evaluator.getTypeClassType(), childClassSelf);
|
4618
4604
|
if (childClassType.shared.typeVarScopeId) {
|
4619
4605
|
overrideType = (0, typeUtils_1.makeTypeVarsBound)(overrideType, [childClassType.shared.typeVarScopeId]);
|
4606
|
+
baseType = (0, typeUtils_1.makeTypeVarsBound)(baseType, [childClassType.shared.typeVarScopeId]);
|
4620
4607
|
}
|
4621
4608
|
if ((0, types_1.isFunction)(baseType) || (0, types_1.isOverloaded)(baseType)) {
|
4622
4609
|
const diagAddendum = new diagnostic_1.DiagnosticAddendum();
|