[transpileDeclaration API][5.5] Self referencing generic type constraint with union gets emitted as unknown
#58598
Labels
Bug
A bug in TypeScript
Domain: Isolated Declarations
Related to the --isolatedDeclarations compiler flag
Domain: ts.transpileDeclaration
Issues regarding the transpileDeclaration API, which do not reproduce without it
π Search Terms
transpiledeclaration type generic constraint unknown self referencing union
π Version & Regression Information
5.5.0-dev.20240519
β― Playground Link
https://www.typescriptlang.org/dev/bug-workbench/?target=7&ts=5.5.0-dev.20240519&ssl=1&ssc=1&pln=3&pc=1#code/PTAEAEGcBcCcEsDG0Bco4FcCmAoEEATLRAGwENYzp4B7AOzU13ygAsaB3AUQFt5o8YNp179oWAgDF4JLGjIA6AguiQcgiADMZWOmR5zQi1TiwAPAA41Y0UInoxQNAEYArYrYC8oAN45QoJo0NGgAPAAqoObidASQoADKWNARAHygAD6gANoAuqkAFACUaABuNPAEoJ7pPgC+ADQ4dQDcOEA
π» Code
π Actual behavior
When using the API, a.d.ts is emitted as
while when using tsc it gets emitted as
π Expected behavior
Using the API should emit
Additional information about the issue
Weird example I know. Trust me that our actual code makes a bit more sense.
The text was updated successfully, but these errors were encountered: