Skip to content

Exhaustiveness check on match fails if subject is function call #16106

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

Closed
schuelermine opened this issue Sep 13, 2023 · 2 comments
Closed

Exhaustiveness check on match fails if subject is function call #16106

schuelermine opened this issue Sep 13, 2023 · 2 comments
Labels
bug mypy got something wrong

Comments

@schuelermine
Copy link

schuelermine commented Sep 13, 2023

Bug Report

Exhaustiveness check on match fails if checked expression is function call

To Reproduce

https://mypy-play.net/?mypy=latest&python=3.11&gist=e12e8ee00b037639ff0887ef65d01d11
is rejected, but
https://mypy-play.net/?mypy=latest&python=3.11&gist=22dc06422f5873e2193134da6fa574a1
is accepted

This also happens with enums

Expected Behavior

Both programs should be accepted

Actual Behavior

main.py:4: error: Missing return statement  [return]
Found 1 error in 1 file (checked 1 source file)

Your Environment

  • Mypy version used: 1.5.1
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files): none
  • Python version used: 3.11
@schuelermine schuelermine added the bug mypy got something wrong label Sep 13, 2023
@schuelermine schuelermine changed the title Exhaustiveness check on match fails if checked expression is function call Exhaustiveness check on match fails if subject is function call Sep 13, 2023
@gandhis1
Copy link

This is a duplicate of #16276. Technically this issue was first, but that one got more attention.

@hauntsaninja
Copy link
Collaborator

Yup, duplicate

@hauntsaninja hauntsaninja closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

3 participants