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
Result.combine is not correctly inferred in the following code with v6.0.0.
import{ok,Result}from'neverthrow'consttuple=<Textendsunknown[]>(...args: T): T=>argsconststring=ok('string')constnumber=ok(1)constnumbers1=Result.combine([...Array(1).keys()].map(ok))constnumbers2=Result.combine([...Array(2).keys()].map(ok))constnumbers3=Result.combine([...Array(3).keys()].map(ok))constnumbers4=Result.combine([...Array(4).keys()].map(ok))// ↓ should be Result<[string, number, number[], number[], number[], number[]], never> but inferred as Result<never, never>constvalues=Result.combine(tuple(string,number,numbers1,numbers2,numbers3,numbers4))
The issue is that currently there's a recursion depth limit of 5 iterations. See #468, where I increase the iteration count to 50 - meaning now neverthrow would be able to have inference of tuples containing up to 50 elements.
Result.combine
is not correctly inferred in the following code with v6.0.0.I made sample repo to reproduce: https://github.com/h-yon/nt-test
Curiously, this problem does not occur when downgrading to v5.0.1 or reducing variable
The text was updated successfully, but these errors were encountered: