Devansh Jethmalani

Results 80 comments of Devansh Jethmalani

> I am not sure of the benefit. You can see the diff of `middlewareTypes.test.tsx` between v3.6.9 and v4. Here's an excerpt... Before (v3.6.9): ```ts const useStore = create< CounterState,...

The PR was for option 2, but now that we went with option 1, we don't need it and #1090 suffices.

I think we can find if a union has many constituents (say more than 15) using something like this... ```ts namespace U { type HasManyConstituents = U extends never ?...

Another much greater possibility is that (afair) we compute index operator deeply (and eagerly) and `Element` has a recursive definition hence we get an infinite recursion. In that case we...

Yep, looks like it's because of recursive definition... ```ts import { p, pa } from "@sthir/predicate" interface MyElement { parentElement: MyElement } pa({} as MyElement, p()) // ~~~ // Type...

I'm too lazy to rewrite the types right now to make index not compute eagerly, so instead in case of recursive types we stop when we come across a type...

https://github.com/devanshj/sthir/commit/e4dfae5d97143dd2f03277dbbc5fa4f60d9549b2 — Pretty weird even with `PathShallow` we still get the "Type instantiation is excessively deep" error. This will require more investigation lmao.

Ah maybe `I.Intersect` also needs to deal with recursive definitions.

@RyanCavanaugh Could I use this thread to ask some quick trivial questions about the codebase? I'm giving a silly shot at writing a PR for this. The question I have...

Your comment/usecase belongs to #51011. This issue is for this specific inference failure in the OP, and here `T extends F` is already allowed because it's not immediately circular.