Skip to content

.with and Pattern.not error since 4.1.3 #138

Closed
@adrienharnay

Description

@adrienharnay

Describe the bug

Since 4.1.3, when using Pattern.not, the following branches will act as if Pattern.not was in fact Pattern.any. If narrowing in following branches cannot be done, then I would expect the contrary (no narrowing on Pattern.not usages).

Code Sandbox with a minimal reproduction case
https://codesandbox.io/s/typescript-playground-export-forked-48dyon?file=/index.ts

Versions

  • TypeScript version: 4.9.4
  • ts-pattern version: 4.1.3
  • environment: Node 18.11.0

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions