type-fest icon indicating copy to clipboard operation
type-fest copied to clipboard

`Type instantiation is excessively deep` in `ReadonlyDeep`

Open marekdedic opened this issue 3 years ago • 2 comments
trafficstars

Hi, I recently updated my declaration of ReadonlyDeep to use the new call signature handling from #359, however, I get error TS2589: Type instantiation is excessively deep and possibly infinite. :(

See the repro in the playground for details.

marekdedic avatar Sep 17 '22 16:09 marekdedic

@marekdedic I'm not sure why you want to make the jQuery object read-only (and deep). It's a huge object with lots of references to HTML objects and as the update includes index signatures all these objects will be made read-only deep which makes TS reach its memory limit very quickly.

skarab42 avatar Sep 19 '22 06:09 skarab42

Hi, for the same reason you'd make anything read-only I think 😀 To have stricter control over what gets modified...

I agree that the jQuery object is huge, that's why it crashes...

marekdedic avatar Sep 20 '22 07:09 marekdedic