From 943a954f540ebd7966f3616baf90b6effad214ba Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Thu, 5 Dec 2024 16:20:51 -0800 Subject: [PATCH] Fixed a bug that results in a crash under certain circumstances when `Self` is errantly specialized. This addresses #9552. --- packages/pyright-internal/src/analyzer/typeEvaluator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/pyright-internal/src/analyzer/typeEvaluator.ts b/packages/pyright-internal/src/analyzer/typeEvaluator.ts index 9252603b8c5b..7d277a175f88 100644 --- a/packages/pyright-internal/src/analyzer/typeEvaluator.ts +++ b/packages/pyright-internal/src/analyzer/typeEvaluator.ts @@ -15617,7 +15617,7 @@ export function createTypeEvaluator( flags: EvalFlags ) { // Self doesn't support any type arguments. - if (typeArgs) { + if (typeArgs && typeArgs.length > 0) { addDiagnostic( DiagnosticRule.reportInvalidTypeArguments, LocMessage.typeArgsExpectingNone().format({