Skip to content

Crash in latest master with new semantics analyzer #6973

Closed

Description

@reinhrst

As requested on #6960, I'm sharing the trace from the crash of the new semantics analyzer.

It crashes in directory with just 1 file (test.py):

import dataclasses


@dataclasses.dataclass(frozen=True)
class Test():
    def __init__(self, **kwargs) -> None:
        super().__init__(**kwargs)
> mypy . --new-semantic-analyzer --show-traceback
./test.py: error: INTERNAL ERROR -- Please try using mypy master on Github:
https://mypy.rtfd.io/en/latest/common_issues.html#using-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 0.710+dev.16ade15bcd2a5b6b02ad2c76b6b13efa6c2ddf0a
Traceback (most recent call last):
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/bin/mypy", line 10, in <module>
    sys.exit(console_entry())
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/__main__.py", line 8, in console_entry
    main(None, sys.stdout, sys.stderr)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/main.py", line 88, in main
    res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/build.py", line 168, in build
    result = _build(sources, options, alt_lib_path, flush_errors, fscache, stdout, stderr)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/build.py", line 228, in _build
    graph = dispatch(sources, manager, stdout)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/build.py", line 2574, in dispatch
    process_graph(graph, manager)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/build.py", line 2887, in process_graph
    process_stale_scc(graph, scc, manager)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/build.py", line 2985, in process_stale_scc
    semantic_analysis_for_scc(graph, scc, manager.errors)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/newsemanal/semanal_main.py", line 80, in semantic_analysis_for_scc
    check_type_arguments(graph, scc, errors)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/newsemanal/semanal_main.py", line 338, in check_type_arguments
    state.tree.accept(analyzer)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/build.py", line 1832, in wrap_context
    yield
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/newsemanal/semanal_main.py", line 338, in check_type_arguments
    state.tree.accept(analyzer)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/nodes.py", line 281, in accept
    return visitor.visit_mypy_file(self)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/newsemanal/semanal_typeargs.py", line 33, in visit_mypy_file
    super().visit_mypy_file(o)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/traverser.py", line 33, in visit_mypy_file
    d.accept(self)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/nodes.py", line 913, in accept
    return visitor.visit_class_def(self)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/newsemanal/semanal_typeargs.py", line 44, in visit_class_def
    super().visit_class_def(defn)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/mixedtraverser.py", line 28, in visit_class_def
    super().visit_class_def(o)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/traverser.py", line 65, in visit_class_def
    o.defs.accept(self)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/nodes.py", line 978, in accept
    return visitor.visit_block(self)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/newsemanal/semanal_typeargs.py", line 48, in visit_block
    super().visit_block(o)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/traverser.py", line 37, in visit_block
    s.accept(self)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/nodes.py", line 655, in accept
    return visitor.visit_func_def(self)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/traverser.py", line 52, in visit_func_def
    self.visit_func(o)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/newsemanal/semanal_typeargs.py", line 40, in visit_func
    super().visit_func(defn)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/mixedtraverser.py", line 23, in visit_func
    self.visit_optional_type(o.type)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/mixedtraverser.py", line 91, in visit_optional_type
    t.accept(self)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/types.py", line 975, in accept
    return visitor.visit_callable_type(self)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/typetraverser.py", line 52, in visit_callable_type
    t.fallback.accept(self)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/types.py", line 666, in accept
    return visitor.visit_instance(self)
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/newsemanal/semanal_typeargs.py", line 54, in visit_instance
    for (i, arg), tvar in zip(enumerate(t.args), info.defn.type_vars):
  File "/Users/reinoud/Envs/tmp-4caf160a3041c9e/lib/python3.7/site-packages/mypy/nodes.py", line 2600, in __getattribute__
    raise AssertionError(object.__getattribute__(self, 'msg'))
AssertionError: fallback can't be filled out until semanal
./test.py: : note: use --pdb to drop into pdb

Activity

  1. ilevkivskyi commented on Jun 11, 2019

    @ilevkivskyi
    Member

    Oh, this will be fixed by #6972.

  2. added a commit that references this issue on Jun 12, 2019
    1fdc95b
  3. added a commit that references this issue on Jun 23, 2019
    bf94169
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions