Skip to content

Use argument and return type line numbers for error messages #3395

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

Merged
merged 1 commit into from
May 22, 2017
Merged

Use argument and return type line numbers for error messages #3395

merged 1 commit into from
May 22, 2017

Conversation

patrickw276
Copy link
Contributor

Fixes #3177

@gnprice gnprice self-assigned this May 22, 2017
@gvanrossum
Copy link
Member

I'll review.

def dec(f): pass

@dec
def test(a: str) -> (str,): # E: Invalid tuple literal type
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test where the ) -> ... part is on a separate line?

def dec(f): pass

@dec
def some_method(self: badtype): pass # E: Name 'badtype' is not defined
Copy link
Member

Choose a reason for hiding this comment

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

imilar with multiple arguments across multiple lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated PR with additional tests.

@gnprice gnprice removed their assignment May 22, 2017
@gvanrossum gvanrossum merged commit 3602a95 into python:master May 22, 2017
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