Skip to content

Quick mode crash when run twice in strict-optional mode #3281

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
gvanrossum opened this issue Apr 28, 2017 · 2 comments · Fixed by #3304
Closed

Quick mode crash when run twice in strict-optional mode #3281

gvanrossum opened this issue Apr 28, 2017 · 2 comments · Fixed by #3304

Comments

@gvanrossum
Copy link
Member

gvanrossum commented Apr 28, 2017

In our codebase we have a case where running quick mode twice crashes.

@euresti reported this.

UPDATE: it's something like

$ rm -rf .mypy_cache
$ mypy -i --strict-optional <files>
<lots of errors>
$ mypy -quick --strict-optional <files>
<lots of errors>
$ mypy -quick --strict-optional <files>
<lots of errors>
<crash>
$
@gvanrossum
Copy link
Member Author

There are lots of errors too. Traceback:

...
  File "/Users/david/src/client/.mypy/venv/lib/python3.6/site-packages/mypy/subtypes.py", line 33, in check_type_parameter
    return is_equivalent(lefta, righta, check_type_parameter)
  File "/Users/david/src/client/.mypy/venv/lib/python3.6/site-packages/mypy/subtypes.py", line 93, in is_equivalent
    is_subtype(a, b, type_parameter_checker, ignore_pos_arg_names=ignore_pos_arg_names)
  File "/Users/david/src/client/.mypy/venv/lib/python3.6/site-packages/mypy/subtypes.py", line 77, in is_subtype
    ignore_pos_arg_names=ignore_pos_arg_names))
  File "/Users/david/src/client/.mypy/venv/lib/python3.6/site-packages/mypy/types.py", line 381, in accept
    return visitor.visit_instance(self)  
  File "/Users/david/src/client/.mypy/venv/lib/python3.6/site-packages/mypy/subtypes.py", line 146, in visit_instance
    rname = right.type.fullname()
AttributeError: 'NoneType' object has no attribute 'fullname'

@gvanrossum
Copy link
Member Author

Hm, I can repro this with an earlier mypy commit (a27963b, from last Thu) but not with master. The repro is kind of expensive so I won't bisect further (though I suspect it's Ivan's 8ecccda "Use dummy TypeInfo ..."), but I'm just going to close this as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant