Skip to content

Conversation

@Andarist
Copy link
Contributor

@Andarist Andarist commented Mar 7, 2023

it's a spiritual follow-up to #52943
the problem was noticed by @jakebailey here

Note that this is how it was already behaving in JSX so it unifies both paths, see the playground here

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Mar 7, 2023
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

errorNode = propDeclaration;

const name = propDeclaration.name!;
errorNode = name;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this basically uses the same strategy to overwrite the errorNode as the one used by the JSX-related code path here:
https://github.dev/microsoft/TypeScript/blob/6dbec02a88156121c24a152d1e8e5e82d52fdc1d/src/compiler/checker.ts#L20691

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

Love it! Are we missing any more cases? 😄

@Andarist
Copy link
Contributor Author

Andarist commented Mar 7, 2023

Love it! Are we missing any more cases? 😄

I plan to grep the test cases against all multi-line errors. I think that this should find all candidates for potential improvements - gonna categorize them and rethink if error spans can be improved for any of them.

@RyanCavanaugh RyanCavanaugh merged commit 4ee8b0f into microsoft:main Mar 7, 2023
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants