KEMBAR78
Thread line/col for lambda parameter to error about covariant typevar by gvanrossum · Pull Request #4275 · python/mypy · GitHub
Skip to content

Conversation

gvanrossum
Copy link
Member

Fixes #4270

@gvanrossum
Copy link
Member Author

@ilevkivskyi Do you think this is the right solution? I spiked on just this error, not sure how many others are similar.

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

This is an old problem. There are few open similar issues still (for example #4231), but I think most of things are fixed now. The situation with column numbers is worse however. I think we need more tests for columns, or we can just update existing tests, I will now open an issue for this.

defn.name() not in ('__init__', '__new__')
):
self.fail(messages.FUNCTION_PARAMETER_CANNOT_BE_COVARIANT, arg_type)
ctx = arg_type # type: Context
Copy link
Member

Choose a reason for hiding this comment

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

I would add a test where problematic argument appears on a separate line.

@gvanrossum gvanrossum merged commit cdbc7db into python:master Nov 22, 2017
@gvanrossum gvanrossum deleted the covarfix branch November 22, 2017 00:31
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.

2 participants