Reverse mapped type fails to be inferred with constraint that is a union containing an intersection #56910
Labels
Possible Improvement
The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
🔎 Search Terms
reverse mapped type inference inferred constraint union intersection
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?ts=5.4.0-dev.20231231#code/CYUwxgNghgTiAEAzArgOzAFwJYHtVNQB4AVeEADwxFWAGd4AlcHGYQ2jGLVAcwBp4qZAFsARiBgA+SQAocogFYAueAG8AUPHgBtANLxu8GQGsQATxyJ4pAGTwARFHsBKeAB8Ho+wF0VxPd4A3OoAvs5+wWB4HPDyCvAAvGqa8FAqACwATHwpoioAjAAMhTlaYCqcyCA5IZHRGPBwtMgQDUmIqHKKzsEA9L1aWgB6APzqQA
💻 Code
🙁 Actual behavior
It fails to infer
T
and uses its constraint🙂 Expected behavior
It should infer
{ a: number; b: number; }
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: