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
The type definition for applyPatches changed from 9.0.2 to 9.0.3. I looked at the diff for the 9.0.3 release and don't see anything that would cause this.
The new type definition is stricter (which is great), but it fails to take advantage of the generic parameter, so it results in TypeScript errors for code that used to work.
I believe that applyPatches should instead be declared as
🐛 Bug Report
The type definition for
applyPatches
changed from 9.0.2 to 9.0.3. I looked at the diff for the 9.0.3 release and don't see anything that would cause this.The new type definition is stricter (which is great), but it fails to take advantage of the generic parameter, so it results in TypeScript errors for code that used to work.
I believe that
applyPatches
should instead be declared asLink to repro
https://codesandbox.io/s/immer-sandbox-forked-y0m5s?file=/src/index.ts
To Reproduce
Infer / implicitly use the return type of
applyPatches
.Observed behavior
A type error occurs, because
applyPatches
could return anything.Expected behavior
Successful compilation, because
applyPatches
says it returns its input type.Environment
setUseProxies(true)
setUseProxies(false)
(ES5 only)The text was updated successfully, but these errors were encountered: