From c9d56c430c458a6c47591727e6022a1abec1c534 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 13 Oct 2023 18:52:39 -0700 Subject: [PATCH] Changed override-related checks (`reportIncompatibleMethodOverride`, `reportIncompatibleVariableOverride` and `reportImplicitOverride`) so they apply to stub files. Previously, these were skipped for stubs. This addresses #6158. --- packages/pyright-internal/src/analyzer/checker.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/pyright-internal/src/analyzer/checker.ts b/packages/pyright-internal/src/analyzer/checker.ts index 8c3e166fa841..1d7af2134027 100644 --- a/packages/pyright-internal/src/analyzer/checker.ts +++ b/packages/pyright-internal/src/analyzer/checker.ts @@ -332,15 +332,14 @@ export class Checker extends ParseTreeWalker { this._validateProtocolTypeParamVariance(node, classTypeResult.classType); } - // Skip the overrides check for stub files. Many of the built-in - // typeshed stub files trigger this diagnostic. Also skip the slots - // check because class variables declared in a stub file are - // interpreted as instance variables. + // Skip the slots check because class variables declared in a stub + // file are interpreted as instance variables. if (!this._fileInfo.isStubFile) { - this._validateBaseClassOverrides(classTypeResult.classType); this._validateSlotsClassVarConflict(classTypeResult.classType); } + this._validateBaseClassOverrides(classTypeResult.classType); + this._validateMultipleInheritanceBaseClasses(classTypeResult.classType, node.name); this._validateMultipleInheritanceCompatibility(classTypeResult.classType, node.name);