Skip to content

ErrorType is never actually used #3063

@refi64

Description

@refi64

...or at least I think so?

Anyway, I was working on a fix for #2998, and I just happened to stumble upon ErrorType. It seemed like the perfect potential solution: make an uninferred variable of type ErrorType, that way you won't get future errors deriving from it. Just to see, though I ran ucg ErrorType over mypy's codebase. Only instances I found were:

  • Its declaration in types.py.
  • All the various visitors.
  • A bunch of if isinstance(xyz, ErrorType): return ErrorType() or similar checks.
  • A comment in join_types claiming non-existent joins return ErrorType. Actually, it never does so (it seems to just fallback to Union.make_simplified_union.
  • An assignment to self.err in TypeFixture's constructor. This is solely used in the tests to make sure joins handle ErrorType correctly...even though it's never actually used outside of that.

So it seems pretty much impossible for an ErrorType to wander into...anywhere, really. Have its uses just declined over time?

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