Skip to content

Commit

Permalink
Removed redundant code from checker.
Browse files Browse the repository at this point in the history
  • Loading branch information
erictraut committed Nov 2, 2023
1 parent 64c9c3f commit 5a7bfaf
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions packages/pyright-internal/src/analyzer/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6170,34 +6170,6 @@ export class Checker extends ParseTreeWalker {
);
}

if (classType) {
this._validateClsSelfParameterType(functionType, classType, /* isCls */ true);
}
} else if (node.name?.value === '__init_subclass__') {
// __init_subclass__ overrides should have a "cls" parameter.
if (node.parameters.length === 0 || !node.parameters[0].name || node.parameters[0].name.value !== 'cls') {
this._evaluator.addDiagnostic(
this._fileInfo.diagnosticRuleSet.reportSelfClsParameterName,
DiagnosticRule.reportSelfClsParameterName,
Localizer.Diagnostic.initSubclassClsParam(),
node.parameters.length > 0 ? node.parameters[0] : node.name
);
}

if (classType) {
this._validateClsSelfParameterType(functionType, classType, /* isCls */ true);
}
} else if (node.name?.value === '__class_getitem__') {
// __class_getitem__ overrides should have a "cls" parameter.
if (node.parameters.length === 0 || !node.parameters[0].name || node.parameters[0].name.value !== 'cls') {
this._evaluator.addDiagnostic(
this._fileInfo.diagnosticRuleSet.reportSelfClsParameterName,
DiagnosticRule.reportSelfClsParameterName,
Localizer.Diagnostic.classGetItemClsParam(),
node.parameters.length > 0 ? node.parameters[0] : node.name
);
}

if (classType) {
this._validateClsSelfParameterType(functionType, classType, /* isCls */ true);
}
Expand Down

0 comments on commit 5a7bfaf

Please sign in to comment.