Fixed a bug in the "type printer" (the component responsible for translating a type into its textual form) for type aliases defined using PEP 695 syntax.

This commit is contained in:
Eric Traut 2024-06-15 18:28:09 +02:00
parent a03eb8492e
commit 6dc3b39902

View File

@ -449,8 +449,19 @@ function printTypeInternal(
typeToWrap = `Literal[${printLiteralValue(type)}]`;
}
} else {
if (type.specialForm) {
return printTypeInternal(
type.specialForm,
printTypeFlags,
returnTypeCallback,
uniqueNameMap,
recursionTypes,
recursionCount
);
}
typeToWrap = printObjectTypeForClassInternal(
type.specialForm ?? type,
type,
printTypeFlags,
returnTypeCallback,
uniqueNameMap,