From ae4bc87530ec5405371f4e9b8ae769bb94e201e3 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sun, 4 Feb 2024 16:22:44 -0800 Subject: [PATCH] Improved misleading diagnostic message when attempting to call a special type form. --- 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 96c8c62f59af..db57205b2aac 100644 --- a/packages/pyright-internal/src/analyzer/typeEvaluator.ts +++ b/packages/pyright-internal/src/analyzer/typeEvaluator.ts @@ -9086,7 +9086,7 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions addDiagnostic( DiagnosticRule.reportCallIssue, LocMessage.objectNotCallable().format({ - type: printType(callTypeResult.type, { expandTypeAlias: true }), + type: printType(callTypeResult.type.specialForm, { expandTypeAlias: true }), }), exprNode );