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

Make reported line and column numbers more precise #7578

Merged
merged 7 commits into from Oct 7, 2019

Conversation

@JukkaL
Copy link
Collaborator

JukkaL commented Sep 27, 2019

Most notably, report more precise error locations for incompatible
return value types and incompatible default argument values.

Also add some tests.

Work towards #7053.

Copy link
Collaborator

ilevkivskyi left a comment

Thanks looks good, just have one question about syntax error in type comment location.

if int():
x = 0 # type: x y
[out]
main:2:9: error: syntax error in type comment 'x y'

This comment has been minimized.

Copy link
@ilevkivskyi

ilevkivskyi Sep 27, 2019

Collaborator

It is not clear what is 9th column here? Maybe keep the intent as 4, otherwise there are two 8-column offsets, the indent itself and also the length of # type: .

This comment has been minimized.

Copy link
@JukkaL

JukkaL Oct 4, 2019

Author Collaborator

A good point, updated.

@@ -133,9 +133,11 @@ def foobar(): pass

[builtins fixtures/module.pyi]

[case testColumnUnexpectedKeywordArg]
[case testColumnUnexpectedOrMissingKeywordArg]
def f(): pass
(f(x=1)) # E:2: Unexpected keyword argument "x" for "f"

This comment has been minimized.

Copy link
@ilevkivskyi

ilevkivskyi Sep 27, 2019

Collaborator

In future we might want to point to x here.

This comment has been minimized.

Copy link
@JukkaL

JukkaL Oct 4, 2019

Author Collaborator

Yeah, added a TODO. I don't think that we can easily find the location of x currently.

@JukkaL JukkaL merged commit cef7a63 into master Oct 7, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@JelleZijlstra JelleZijlstra deleted the columns-5-misc branch Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.