You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem here is that when u add ur d property you make the whole object "partially inferrable" and the inference algorithm successfully infers { sss: number; }. At the same time, the other part of the object is non-inferrable (due to the presence of context-sensitive functions). Judging by the observable results the parameter types are pulled before inferences for this reverse mapped type (T) can be made (maybe before a candidate for that T can even be created).
When the property is not included no inferences are made in the first pass~ and the reverse mapped type and TS avoids pulling the parameter types. In the second pass~ the candidate for T can finally be created and it resolves much better in your case.
π Search Terms
The generic type cannot be successfully inferred.
π Version & Regression Information
5.3
β― Playground Link
https://www.typescriptlang.org/play?#code/C4TwDgpgBMEM7APoCMA8AVANFAwugGgHxQC8U6UEAHrAHYAmcUA3gL5QD8LUA2gNJQAlrSgBrCCAD2AM3IBdAFzl+cyjQgMmACgDGwKkoCGtENklhgcIyewA6e4YBOAcytDa0iI6gAFAJSkxMKe3gBKnFC6+kp4+GYWbsxioqJKtACuALbIXlCsdg4ubv6BUOFpEABuuexKAEwA3ABQ0um0eoKSIoY9hqgAItjohFrASkn0HEqDUNJT5FAAPjDwSGhY3HBbaVk53qzErAFJrE29hlrMTVA3UAD0d1D041BbbgCMdQDMedgPuJJMpkNMBhM4YAALQRMAA2wmgknSwCgAHdBDCYVAQIIIDD6E9BNIQiCoI54OkYZZbNdbtJxjTbrcLnoqPFLNhescGYyeSzbG9uYz8oLbsgoqyoOZ2VBOSwRTyoHyBQqbsKVYrxWy4Byelz1YylVt5b9jW8lAByAACCCcwHNmG5wqOQA
π» Code
π Actual behavior
The error occurred after set
d
.π Expected behavior
It should always converge successfully.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: