Add a regression test for completion list in object literal involving inferred obj with optional members #48910
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is just a regression test.
I was investigating a case that I've discovered some time ago but I discovered that it got fixed in 4.6. So I've decided to check if my issue was fixed directly or if, perhaps, it was fixed accidentally - and in general, I've wanted to check how it was fixed ;p
I was able to narrow down the fix to this PR: https://github.com/microsoft/TypeScript/pull/46743/files and I've confirmed locally that removing this single line of code brings the issue back. As we can see - the fixed issue by this PR is a different one, so I think that it's worth adding my case as a regression PR.
I've prepared a TS 4.5 playground demonstrating the issue. You can compare it with the TS 4.6 playground where the issue is gone.
I don't really understand the fix - didn't have time to dig into this deeper. Perhaps @a-tarasyuk or @andrewbranch would understand why does it help for this case too.