Skip to content

unknown variant unreachable-match-case #3396

Closed

Description

@JanEricNitschke

Describe the Bug

I am trying to set up a maximally strict pyrefly config. For that i use this:

[tool.pyrefly]
project-includes = ["src"]
project-excludes = ["tests"]
preset = "strict"
infer-with-first-use = true

[tool.pyrefly.errors]
implicit-abstract-class = "error"
missing-source = "error"
not-required-key-access = "error"
open-unpacking = "error"
unannotated-return = "error"
deprecated = "error"
implicit-import = "error"
non-exhaustive-match = "error"
redundant-cast = "error"
redundant-condition = "error"
unnecessary-comparison = "error"
unnecessary-type-conversion = "error"
unreachable = "error"
unreachable-match-case = "error"
unresolvable-dunder-all = "error"
untyped-import = "error"
variance-mismatch = "error"

However when i run pyrefly check i get this error

$ pyrefly check
 WARN Config at `.../pyproject.toml` failed to parse, checking with default configuration
ERROR .../pyproject.toml: TOML parse error at line 197, column 1
    |
197 | [tool.pyrefly]
    | ^^^^^^^^^^^^^^
unknown variant `unreachable-match-case`, expected one of `abstract-method-call`, `annotation-mismatch`, `assert-type`, `bad-argument-count`, `bad-argument-type`, `bad-assignment`, `bad-class-definition`, `bad-context-manager`, `bad-dunder-all`, `bad-function-definition`, `bad-index`, `bad-instantiation`, `bad-keyword-argument`, `bad-match`, `bad-override`, `bad-override-mutable-attribute`, `bad-override-param-name`, `bad-param-name-override`, `bad-raise`, `bad-return`, `bad-specialization`, `bad-typed-dict`, `bad-typed-dict-key`, `bad-unpacking`, `deprecated`, `division-by-zero`, `implicit-abstract-class`, `implicit-any`, `implicit-any-attribute`, `implicit-any-empty-container`, `implicit-any-parameter`, `implicit-any-type-argument`, `implicit-import`, `implicitly-defined-attribute`, `incompatible-overload-residual`, `inconsistent-inheritance`, `inconsistent-overload`, `inconsistent-overload-default`, `internal-error`, `invalid-annotation`, `invalid-argument`, `invalid-decorator`, `invalid-inheritance`, `invalid-literal`, `invalid-overload`, `invalid-param-spec`, `invalid-pattern`, `invalid-self-type`, `invalid-super-call`, `invalid-syntax`, `invalid-type-alias`, `invalid-type-var`, `invalid-type-var-tuple`, `invalid-variance`, `invalid-yield`, `missing-argument`, `missing-attribute`, `missing-import`, `missing-module-attribute`, `missing-override-decorator`, `missing-source`, `missing-source-for-stubs`, `name-mismatch`, `no-access`, `no-matching-overload`, `non-convergent-recursion`, `non-exhaustive-match`, `not-a-type`, `not-async`, `not-callable`, `not-iterable`, `not-required-key-access`, `open-unpacking`, `parse-error`, `protocol-implicitly-defined-attribute`, `read-only`, `redefinition`, `redundant-cast`, `redundant-condition`, `reveal-type`, `unannotated-attribute`, `unannotated-parameter`, `unannotated-protocol-member`, `unannotated-return`, `unbound-name`, `unexpected-keyword`, `unexpected-positional-argument`, `unimported-directive`, `unknown-name`, `unnecessary-comparison`, `unnecessary-type-conversion`, `unreachable`, `unresolvable-dunder-all`, `unsafe-overlap`, `unsupported`, `unsupported-delete`, `unsupported-operation`, `untyped-import`, `unused-coroutine`, `unused-ignore`, `variance-mismatch`

Fatal configuration error

Despite the docs clearly mentioning this confirugation option: https://pyrefly.org/en/docs/error-kinds/#unreachable-match-case

I am on version 1.0.0

Sandbox Link

No response

(Only applicable for extension issues) IDE Information

No response

Activity

  1. rchen152 commented on May 15, 2026

    @rchen152
    Contributor

    Thanks for the report! Looks like what happened is that the commit splitting unreachable-match-case out of unreachable just barely didn't make it into 1.0.0 (6aa1e50), and the docs are ahead of the release. For now, just using unreachable = "error" in your config is sufficient.

  2. self-assigned this
    on May 15, 2026
  3. JanEricNitschke commented on May 15, 2026

    @JanEricNitschke
    Author

    Thanks for the reply, thats what i had assumed. I think the same happend with "pyrefly report" which was renamed just after the release to "pyrefly coverage report".

  4. added this to the v1.1 milestone on May 19, 2026
  5. rchen152 commented on May 19, 2026

    @rchen152
    Contributor

    Thanks! I corrected the documentation for unreachable-match-case; I'll fix up pyrefly coverage report as well.

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

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions