Closed smolijar closed 6 years ago
2.8.3
:bug:
2.9.2
:bug:
3.1.6
:ok:
3.2.1
:bug:
I ran through some TS versions, the issue does not appear in 3.1.6
but does in versions before and after it. Hope it helps.
@grissius Thanks for the report. I'll take a look at fixing the type assignability here, or just remove array-flatten
if I don't figure it out.
@grissius I think I have the solution here - I'll update array-flatten
to take an interface of ReadonlyArray
so the mutation interfaces won't be considered (e.g. the issue here is Array#pop()
and NestedArray#pop()
would return incompatible types).
Released with https://github.com/blakeembrey/array-flatten/releases/tag/v2.1.2, it's a sub-dependency though so I'll look at pushing out a new patch for this library too with the dependency upgraded.
Using v
5.0.0
Problem description
In the following snippet, typescript template arguments are not inferred correctly.
I expose the
compose
fn aspipeMiddleware
, accepting flat array spreaded arguments:This works in
typescript@3.1.6
flawlessly, however, in currenttypescript@3.2.1
it produces the following error:Notice the first line, type template parameters (
Handler<Error, Request, void>
) are incorrectly inferred.Temp solution
Declaring template arguments explicitly does the trick for my case.
Assumed cause
This might be a bug in
flatten
types.If
compose-middleware
's typeHandler
is changed fromto
it works flawlessly again (I use only flat simple arrays in my app.)