pycharm 2025.1.2 show match state as unreachable

I've recenlty updated to pycharm 2025.1.2 and it now shows the match xxx: lines as unreachable

eg code:

from enum import StrEnum


class SomeEnum(StrEnum):
    SomeValue = "some_value"
    OtherValue = "other_value"


def check_value(entry: SomeEnum) -> bool | None:
    match entry:
        case SomeEnum.SomeValue:
            return True
        case SomeEnum.OtherValue:
            return False


assert check_value("toto") is None
assert check_value(SomeEnum.SomeValue) is True
assert check_value(SomeEnum.OtherValue) is False

 

PyCharm 2025.1.2
Build #PY-251.26094.141, built on June 10, 2025
Source revision: 0f4e379ff77b9
Licensed to Veeva Systems

Runtime version: 21.0.7+9-b895.130 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 15.5
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 8192M
Cores: 16
Metal Rendering is ON
Registry:
  ide.experimental.ui=true
Non-Bundled Plugins:
  name.kropp.intellij.makefile (251.25410.28)
  com.intellij.mermaid (0.0.25+IJ.243)
  de.timo_reymann.intellij-mjml-support (5.0.1)
1
正式评论

Hi Thomas

 

Thank you for reaching out, 

 

The issue seems to be related to this regression:

https://youtrack.jetbrains.com/issue/PY-80565/False-warning-auto-not-assignable-to-StrEnum

 

The issue has been already fixed and currently available in the latest EAP release (Pycharm 2025.2 EAP 3)

Please feel free to give it a try in the EAP or wait for the next stable release (2025.1.3)

 

Kind regards,

 

 

请先登录再写评论。