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

Better error message for assignments and returns incompatible due to invariance #6803

Conversation

@lipemorais
Copy link
Contributor

commented May 8, 2019

The tests are failing probably because I'm checking the INCOMPATIBLE_TYPES_IN_ASSIGNMENT not at the right part of this method.

I also not sure if the type expected by append_invariance_notes that I am passing to it, the subtype and the supertype because the test that I created work but it do not work for several other tests.

Most of the error are something like: AttributeError: 'TypeType' object has no attribute 'type'

Can someone help me with it?

Here are two examples:

__________________________________ testTypeUsingTypeCTypeAnyMember __________________________________
[gw0] darwin -- Python 3.7.3 /Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/bin/python3.7
data: /Users/felipe/projects/python/mypy/test-data/unit/check-classes.test:3018:
SystemExit: 2
--------------------------------------- Captured stdout call ----------------------------------------
main:6: error: Revealed type is 'Any'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 8, in <module>
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 1525, in serve
    SlaveGateway(io=io, id=id, _startcount=2).serve()
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 1038, in serve
    self._execpool.integrate_as_primary_thread()
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 250, in integrate_as_primary_thread
    self._perform_spawn(reply)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 268, in _perform_spawn
    reply.run()
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 204, in run
    self._result = func(*args, **kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 1063, in executetask
    do_exec(co, loc)  # noqa
  File "<string>", line 1, in do_exec
  File "<remote exec>", line 249, in <module>
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/main.py", line 242, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/main.py", line 209, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/main.py", line 249, in _main
    config.hook.pytest_runtestloop(session=session)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "<remote exec>", line 67, in pytest_runtestloop
  File "<remote exec>", line 84, in run_one_test
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 78, in pytest_runtest_protocol
    runtestprotocol(item, nextitem=nextitem)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 93, in runtestprotocol
    reports.append(call_and_report(item, "call", log))
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 173, in call_and_report
    call = call_runtest_hook(item, when, **kwds)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 198, in call_runtest_hook
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 226, in from_call
    result = func()
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 198, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 123, in pytest_runtest_call
    item.runtest()
  File "/Users/felipe/projects/python/mypy/mypy/test/data.py", line 223, in runtest
    suite.run_case(self)
  File "/Users/felipe/projects/python/mypy/mypy/test/testcheck.py", line 123, in run_case
    self.run_case_once(testcase)
  File "/Users/felipe/projects/python/mypy/mypy/test/testcheck.py", line 185, in run_case_once
    alt_lib_path=test_temp_dir)
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 164, in build
    result = _build(sources, options, alt_lib_path, flush_errors, fscache)
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 220, in _build
    graph = dispatch(sources, manager)
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 2490, in dispatch
    process_graph(graph, manager)
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 2802, in process_graph
    process_stale_scc(graph, scc, manager)
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 2909, in process_stale_scc
    graph[id].type_check_first_pass()
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 2022, in type_check_first_pass
    self.type_checker().check_first_pass()
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 284, in check_first_pass
    self.accept(d)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 395, in accept
    stmt.accept(self)
  File "/Users/felipe/projects/python/mypy/mypy/nodes.py", line 655, in accept
    return visitor.visit_func_def(self)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 706, in visit_func_def
    self._visit_func_def(defn)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 710, in _visit_func_def
    self.check_func_item(defn, name=defn.name())
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 772, in check_func_item
    self.check_func_def(defn, typ, name)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 938, in check_func_def
    self.accept(item.body)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 395, in accept
    stmt.accept(self)
  File "/Users/felipe/projects/python/mypy/mypy/nodes.py", line 978, in accept
    return visitor.visit_block(self)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 1769, in visit_block
    self.accept(s)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 395, in accept
    stmt.accept(self)
  File "/Users/felipe/projects/python/mypy/mypy/nodes.py", line 1036, in accept
    return visitor.visit_assignment_stmt(self)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 1777, in visit_assignment_stmt
    self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 1879, in check_assignment
    rvalue_type = self.check_simple_assignment(lvalue_type, rvalue, lvalue)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 2582, in check_simple_assignment
    '{} has type'.format(lvalue_name))
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 3566, in check_subtype
    notes = append_invariance_notes([], subtype,  supertype)
  File "/Users/felipe/projects/python/mypy/mypy/messages.py", line 1612, in append_invariance_notes
    if (arg_type.type.fullname() == 'builtins.list' and
AttributeError: 'TypeType' object has no attribute 'type'
--------------------------------------- Captured stderr call ----------------------------------------
main:8: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.710+dev.a55d2ad3266c8357d22c8cae1545e815949f2225
main:8: : note: use --pdb to drop into pdb
_________________________________ testInstanceMethodOverwriteError __________________________________
[gw1] darwin -- Python 3.7.3 /Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/bin/python3.7
data: /Users/felipe/projects/python/mypy/test-data/unit/check-classes.test:3860:
SystemExit: 2
--------------------------------------- Captured stdout call ----------------------------------------
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 8, in <module>
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 1525, in serve
    SlaveGateway(io=io, id=id, _startcount=2).serve()
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 1038, in serve
    self._execpool.integrate_as_primary_thread()
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 250, in integrate_as_primary_thread
    self._perform_spawn(reply)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 268, in _perform_spawn
    reply.run()
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 204, in run
    self._result = func(*args, **kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/execnet/gateway_base.py", line 1063, in executetask
    do_exec(co, loc)  # noqa
  File "<string>", line 1, in do_exec
  File "<remote exec>", line 249, in <module>
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/main.py", line 242, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/main.py", line 209, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/main.py", line 249, in _main
    config.hook.pytest_runtestloop(session=session)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "<remote exec>", line 67, in pytest_runtestloop
  File "<remote exec>", line 84, in run_one_test
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 78, in pytest_runtest_protocol
    runtestprotocol(item, nextitem=nextitem)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 93, in runtestprotocol
    reports.append(call_and_report(item, "call", log))
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 173, in call_and_report
    call = call_runtest_hook(item, when, **kwds)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 198, in call_runtest_hook
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 226, in from_call
    result = func()
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 198, in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/felipe/.local/share/virtualenvs/mypy-WvJTD_Lt/lib/python3.7/site-packages/_pytest/runner.py", line 123, in pytest_runtest_call
    item.runtest()
  File "/Users/felipe/projects/python/mypy/mypy/test/data.py", line 223, in runtest
    suite.run_case(self)
  File "/Users/felipe/projects/python/mypy/mypy/test/testcheck.py", line 123, in run_case
    self.run_case_once(testcase)
  File "/Users/felipe/projects/python/mypy/mypy/test/testcheck.py", line 185, in run_case_once
    alt_lib_path=test_temp_dir)
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 164, in build
    result = _build(sources, options, alt_lib_path, flush_errors, fscache)
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 220, in _build
    graph = dispatch(sources, manager)
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 2490, in dispatch
    process_graph(graph, manager)
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 2802, in process_graph
    process_stale_scc(graph, scc, manager)
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 2909, in process_stale_scc
    graph[id].type_check_first_pass()
  File "/Users/felipe/projects/python/mypy/mypy/build.py", line 2022, in type_check_first_pass
    self.type_checker().check_first_pass()
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 284, in check_first_pass
    self.accept(d)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 395, in accept
    stmt.accept(self)
  File "/Users/felipe/projects/python/mypy/mypy/nodes.py", line 913, in accept
    return visitor.visit_class_def(self)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 1582, in visit_class_def
    self.accept(defn.defs)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 395, in accept
    stmt.accept(self)
  File "/Users/felipe/projects/python/mypy/mypy/nodes.py", line 978, in accept
    return visitor.visit_block(self)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 1769, in visit_block
    self.accept(s)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 395, in accept
    stmt.accept(self)
  File "/Users/felipe/projects/python/mypy/mypy/nodes.py", line 1036, in accept
    return visitor.visit_assignment_stmt(self)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 1777, in visit_assignment_stmt
    self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax)
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 1837, in check_assignment
    if self.check_compatibility_all_supers(lvalue, lvalue_type, rvalue):
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 1951, in check_compatibility_all_supers
    base_node):
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 2012, in check_compatibility_super
    'base class "%s" defined the type as' % base.name())
  File "/Users/felipe/projects/python/mypy/mypy/checker.py", line 3566, in check_subtype
    notes = append_invariance_notes([], subtype,  supertype)
  File "/Users/felipe/projects/python/mypy/mypy/messages.py", line 1612, in append_invariance_notes
    if (arg_type.type.fullname() == 'builtins.list' and
AttributeError: 'CallableType' object has no attribute 'type'
--------------------------------------- Captured stderr call ----------------------------------------
main:5: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.710+dev.a55d2ad3266c8357d22c8cae1545e815949f2225
main:5: : note: use --pdb to drop into pdb

Fixes: #4186

lipemorais and others added some commits May 7, 2019

Make typshed submodules instructions more explicit to avoid first tim…
…ers struggles.

After clone the project I was not able to find the folder for typeshed because I was looking for it at the mypy repo folder but actually there is a second folder also called mypy where the typeshed folder will be, the right path is 'mypy/mypy/typeshed'.
@ilevkivskyi
Copy link
Collaborator

left a comment

Thank you for the PR! The general idea looks right, here I have few comments.

mypy/checker.py Outdated Show resolved Hide resolved
mypy/checker.py Outdated Show resolved Hide resolved
mypy/checker.py Outdated Show resolved Hide resolved
test-data/unit/check-basic.test Show resolved Hide resolved

@lipemorais lipemorais force-pushed the lipemorais:better-error-message-for-assignments-incompatible-due-to-invariance branch from fb4edbd to 95a86e0 May 8, 2019

@ilevkivskyi

This comment has been minimized.

Copy link
Collaborator

commented May 8, 2019

Also please don't force push, it makes reviewing harder, just add more commits to the branch.

@ilevkivskyi
Copy link
Collaborator

left a comment

Great, thanks for updates! I think this is now ready to be merged.

@ilevkivskyi ilevkivskyi changed the title WIP: Better error message for assignments incompatible due to invariance Better error message for assignments and returns incompatible due to invariance May 9, 2019

@ilevkivskyi ilevkivskyi merged commit 1ea1122 into python:master May 9, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.