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

Error location show incorrect file. #16175

Open
jenstroeger opened this issue Sep 25, 2023 · 4 comments
Open

Error location show incorrect file. #16175

jenstroeger opened this issue Sep 25, 2023 · 4 comments
Labels

Comments

@jenstroeger
Copy link

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
@PrathamLalwani
Copy link

@ilevkivskyi Can I contribute to this issue? This will be my first commit to the repo but have been writing python using mypy for years.

@ilevkivskyi
Copy link
Member

Yes, you can give it a try. I may be not the easiest bug to fix, but definitely an important one.

@PrathamLalwani
Copy link

Is it okay if I use this thread to show my discoveries of the bug, to get feedback? or is there other way to get some help if I am stuck ( If I am stuck for a week)?

@ilevkivskyi
Copy link
Member

Yes, you can post here (but I can't guarantee I will always reply quickly).

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

No branches or pull requests

3 participants