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
{{ message }}
Repository navigation
Regression in 7.1 (#64553): R inferred as unknown through a generic type alias call signature with a nested same-type argument #64757
R is inferred as Req, so r is [Req], as in 5.9.3, 7.0.2 and 7.1.0-dev.20260929.1.
Additional information about the issue
The tsc-rs maintainers traced it to the depth-2 nesting check in invokeOnce (isDeeplyNestedType(..., 2), about line 363 of inference.go). #64553 now sends the Effect/Effect pair through it. For Effect<() => Effect<A, R>>, the check treats the inner pair as a cycle and infers nothing for the inner R. It only happens when the signature comes from an instantiated generic type alias (Make<P> above). Calling a plain generic function with the same shape infers Req.
Real-world impact: this is the shape of Effect 4's HttpRouter.middleware<...>()(...), whose signature is the generic alias middleware.Make<Provides, Handles>. A middleware written with Effect.fn or Effect.gen that reads the request gets R = unknown, and .layer resolves to the string type "Need to .combine(middleware) that satisfy the missing request dependencies". In one Effect app this cascades into 145 errors.
Activity