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

Remove special casing for "cannot" in error messages #15365

Closed
wants to merge 3 commits into from

Conversation

hauntsaninja
Copy link
Collaborator

This tripped me up the other day when grepping for an error message. Thanks to ikonst's --update-data improvements, very easy to fix everywhere.

This tripped me up the other day when grepping for an error message.
Thanks to ikonst's --update-data improvements, trivial to fix
everywhere.
@hauntsaninja hauntsaninja marked this pull request as draft June 4, 2023 06:54
@@ -2019,7 +2019,7 @@ tmp/foo.pyi:5: note: @overload
tmp/foo.pyi:5: note: def __add__(self, int, /) -> int
tmp/foo.pyi:5: note: @overload
tmp/foo.pyi:5: note: def __add__(self, str, /) -> str
tmp/foo.pyi:5: note: Overloaded operator methods cannot have wider argument types in overrides
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel like it's better to change all these to "cannot" in the place where we generate the message; "can't" is a little too informal.

@ikonst
Copy link
Contributor

ikonst commented Jun 4, 2023

That was what I was about to do next ;)

@ikonst
Copy link
Contributor

ikonst commented Jun 13, 2023

A handful of errors remain:

FAILED mypy/test/testsemanal.py::SemAnalSuite::semanal-statements.test::testDelMultipleThingsInvalid
FAILED mypy/test/testsemanal.py::SemAnalErrorSuite::semanal-errors.test::testInvalidLvalues10
FAILED mypy/test/testsemanal.py::SemAnalErrorSuite::semanal-errors.test::testInvalidLvalues11
FAILED mypy/test/testtransform.py::TransformSuite::semanal-statements.test::testDelMultipleThingsInvalid

Can we merge this? I think it'll be nice to collapse some [out]s into inline comments once it's done.

@JelleZijlstra
Copy link
Member

If @hauntsaninja is too busy to finish this PR, feel free to create an alternative PR finishing this one, and I'll take a look.

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

Successfully merging this pull request may close these issues.

3 participants