Skip to content

Commit

Permalink
Changed override-related checks (reportIncompatibleMethodOverride, …
Browse files Browse the repository at this point in the history
…`reportIncompatibleVariableOverride` and `reportImplicitOverride`) so they apply to stub files. Previously, these were skipped for stubs. This addresses #6158. (#6159)
  • Loading branch information
erictraut authored Oct 14, 2023
1 parent 398c3f1 commit e300a26
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/pyright-internal/src/analyzer/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e300a26

Please sign in to comment.