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
Closure passed to a callable parameter is typed from a previous call of a captured closure (bleedingEdge, 2.3.6) #15757
With bleedingEdge enabled, an arrow function that calls a captured closure is reported as not matching the callable parameter it is passed to, when an earlier arrow function in the same scope called that closure with a different argument.
The template type U is inferred from the call $doubleFn(1) (-2..7), but the closure that is checked against it is typed as if $doubleFn(1) returned what the previous $doubleFn($index) call returned (0..18), so it ends up as Closure(int): (-18..9). Both sides describe the same arrow function, so they should agree.
Only with bleedingEdge: the same code analyses without errors when bleedingEdge is off.
Removing the first mapx() call, or calling the closure with the same argument in both, makes the error go away.
New in 2.3.6 for us (2.3.5 did not report it); it still reproduces on the playground.
Activity