From 726b3a09ceb1540bf7c56814af78a9110900cfe8 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Thu, 26 Sep 2024 11:59:20 -0700 Subject: [PATCH] Fixed bug with the provisional `TypeForm` support that breaks aliases of `Annotated`. This addresses #9092. --- 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 86c971f16ca4..55fe5225947d 100644 --- a/packages/pyright-internal/src/analyzer/typeEvaluator.ts +++ b/packages/pyright-internal/src/analyzer/typeEvaluator.ts @@ -1679,7 +1679,7 @@ export function createTypeEvaluator( updatedFlags &= ~EvalFlags.TypeFormArg; - if (node.d.annotation) { + if (node.d.annotation && (flags & EvalFlags.TypeExpression) !== 0) { return getTypeOfExpression(node.d.annotation, updatedFlags); }