Skip to content

Conversation

weswigham
Copy link
Member

Fixes #58430

Like #58428, this takes a case where the checker usually issues an error and blocks declaration emit and adjusts the output to match what isolatedDeclaration users expect - retaining the input type node (note that I've flagged this behind the flag I added in #58428 (and renamed that flag to be a bit more general) so error messages will still print any instead of whatever node produced the error).

I actually had this change in one of my older omnibus node builder improvement PRs, but it got lost when I was breaking things up to be more reviewable.

@weswigham weswigham requested a review from jakebailey May 8, 2024 17:00
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels May 8, 2024
@@ -146,7 +146,7 @@ declare function flatMap(): any;
* @template T
* @type {Call<T>}
*/
declare const identity: any;
declare const identity: Call<T>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a Type Call is not generic error on the input here, so the output is fairly flexible. Preserving the erroneous input node is fine, since it's what isolatedDeclarations wants.

@weswigham weswigham marked this pull request as ready for review May 8, 2024 17:07
@weswigham weswigham merged commit fece7f1 into microsoft:main May 8, 2024
@weswigham weswigham deleted the preserve-unresolved-error-type-nodes-in-declaration-emit branch May 8, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[transpileDeclaration API][5.5] Type-only import is missing when type is used as arrow function argument
3 participants