No contextual types from circular mapped type properties by ahejlsberg · Pull Request #38653 · microsoft/TypeScript (original) (raw)

With this PR we no longer attempt to produce contextual types from mapped type properties that are circular. Specifically, in getTypeOfPropertyOfContextualType we now check if the property originates in mapped type and if resolution of the type of the property would cause a circularity. If so, instead of resolving the type (which would produce a circularity error) we simply return undefined to indicate that there is no contextual type.

I have added the simplified repro from #38279 to the tests, plus I have manually verified that each of the complex repros in that issue no longer error.

Fixes #38279.