8000 Changed `type_assert` diagnostics to fall under `reportGeneralTypeIss… · codemuse-app/scip-python@4784a9e · GitHub
[go: up one dir, main page]

Skip to content

Commit 4784a9e

Browse files
committed
Changed type_assert diagnostics to fall under reportGeneralTypeIssues diagnostic rule rather than be emitted unconditionally.
1 parent 0bcf445 commit 4784a9e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/pyright-internal/src/analyzer/typeEvaluator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6950,7 +6950,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
69506950
const assertedType = convertToInstance(getTypeOfArgumentExpectingType(node.arguments[1]).type);
69516951

69526952
if (!isTypeSame(assertedType, arg0TypeResult.type)) {
6953-
addError(
6953+
addDiagnostic(
6954+
AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.reportGeneralTypeIssues,
6955+
DiagnosticRule.reportGeneralTypeIssues,
69546956
Localizer.Diagnostic.assertTypeTypeMismatch().format({
69556957
expected: printType(assertedType),
69566958
received: printType(arg0TypeResult.type),

0 commit comments

Comments
 (0)
0