vscode-haskell
vscode-haskell copied to clipboard
Bump ts-pattern from 5.7.0 to 5.7.1
Bumps ts-pattern from 5.7.0 to 5.7.1.
Release notes
Sourced from ts-pattern's releases.
v5.7.1
Type inference bug fixes
This new release fixes the following bug in exhaustiveness checking when matching on optional properties:
type Input = { type?: 'one' } | { type: 'two' };const f1 = (input: Input) =>
match(input)
.with({ type: 'one' }, () => {})
.with({ type: 'two' }, () => {})
.exhaustive(); // shouldn't type-check, but does 👎const f2 = (input: Input) =>
match(input)
.with({ type: 'one' }, () => {})
.with({ type: 'two' }, () => {})
.with({ type: undefined }, () => {}) // <- the type key needs to be present.
.exhaustive(); // shouldn't type-check, but does 👎
These two cases don't type check anymore. They fail with a
NonExhaustiveError<{ type?: undefined; }>. To fix it, you should do:type Input = { type?: 'one' } | { type: 'two' };const f = (input: Input) =>
match(input)
.with({ type: 'one' }, () => {})
.with({ type: 'two' }, () => {})
.with({ type: P.optional(undefined) }, () => {}) // <- the type property may not be there
.exhaustive(); // ✅
This is a purely type-level change, the runtime behavior is still the same.
What's Changed
- fix(.exhaustive): optional discriminant by
@gvergnaudin gvergnaud/ts-pattern#319Full Changelog: https://github.com/gvergnaud/ts-pattern/compare/v5.7.0...v5.7.1
Commits
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)