Skip to content
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

ErrorType is never actually used #3063

Closed
refi64 opened this issue Mar 27, 2017 · 2 comments
Closed

ErrorType is never actually used #3063

refi64 opened this issue Mar 27, 2017 · 2 comments

Comments

@refi64
Copy link
Contributor

refi64 commented Mar 27, 2017

...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?

@gvanrossum
Copy link
Member

I think @JukkaL is also working on a solution for that.

@gvanrossum gvanrossum assigned JukkaL and unassigned JukkaL Mar 27, 2017
gvanrossum pushed a commit that referenced this issue Apr 1, 2017
@gvanrossum
Copy link
Member

Well, it seems you're right, killing it was really easy.

JukkaL pushed a commit that referenced this issue Apr 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants