Skip to content

Expected type in class pattern; found "Any" for ignored missing import in match/case #14477

Closed
@ds-cbo

Description

@ds-cbo

To Reproduce

from somewhere import Foo

match None:
    case Foo():
        ...

https://mypy-play.net/?mypy=latest&python=3.11&flags=ignore-missing-imports&gist=03694364e4e855575f23ba9c625e804e

Expected Behavior

no error

Actual Behavior

$ mypy --ignore-missing-imports test.py
test.py:4: error: Expected type in class pattern; found "Any"  [misc]
Found 1 error in 1 file (checked 1 source file)

Your Environment

mypy 0.991 without config files on python 3.10 and 3.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-match-statementPython 3.10's match statement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions