Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS] nothing cannot be distinguished from undefined return #275

Closed
aleclarson opened this issue Dec 18, 2018 · 1 comment
Closed

[TS] nothing cannot be distinguished from undefined return #275

aleclarson opened this issue Dec 18, 2018 · 1 comment

Comments

@aleclarson
Copy link
Member

import {produce, nothing} from 'immer'

// Okay 👍
const A: undefined = produce({}, s => nothing)

// Error 😔
const B: {readonly a: number} = produce({a: 1}, s => void s.a++)

This will be fixed in v1.9.3

aleclarson added a commit that referenced this issue Dec 18, 2018
- fix edge cases with inferred return value
- ensure `nothing` can be distinguished from `undefined`
- allow rest arguments for curried producer w/o initial state

Fixes #274
Fixes #275
aleclarson added a commit that referenced this issue Dec 18, 2018
- infer the base type properly
- infer the return type properly
- ensure `nothing` can be distinguished from `undefined`
- allow rest arguments for curried producer w/o initial state

Fixes #273
Fixes #274
Fixes #275
@aleclarson
Copy link
Member Author

🎉 This issue has been resolved in version 1.9.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant