Skip to content

Error location show incorrect file. #16175

Open
@jenstroeger

Description

@jenstroeger

Following up on issue HypothesisWorks/hypothesis#3753: the failing example in that issue always shows the test.py file as the originating file, which is incorrect:

test.py:1139:50: error: Cannot use a covariant type variable as a parameter  [misc]

The file containing the failing type check is called from test.py.

To Reproduce

See the referenced issue: install Hypothesis and mypy using the mentioned versions, and run the example.

Expected Behavior

Error location should show the file that contains the failing type check.

Actual Behavior

Error location shows the file file that contains the call to the failing type check.

Your Environment

  • Mypy version used: 1.5.1
  • Mypy command-line flags: mypy --show-traceback --config-file pyproject.toml test.py
  • Mypy configuration options from pyproject.toml:
     [tool.mypy]
     # mypy_path =
     # exclude =
     show_error_codes = true
     show_column_numbers = true
     check_untyped_defs = true
     incremental = false
     strict_equality = true
     warn_return_any = true
     warn_redundant_casts = true
     warn_unreachable = true
     warn_unused_configs = true
     warn_unused_ignores = true
     disallow_untyped_calls = true
     disallow_untyped_defs = true
     disallow_incomplete_defs = true
     disallow_untyped_decorators = true
     disable_error_code = []
     
     [[tool.mypy.overrides]]
     module = [
     ]
     ignore_missing_imports = true
  • Python version used: python 3.10.13 (main, Aug 25 2023, 01:44:57) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions