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

Give more detail about original definition when override is incompatible #6808

Closed
JukkaL opened this issue May 9, 2019 · 3 comments
Closed
Labels
priority-1-normal topic-error-reporting How we report errors topic-inheritance Inheritance and incompatible overrides topic-usability

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented May 9, 2019

If a method override is incompatible with the definition in a base class, it would be helpful to give the file + line number of the base class definition. Maybe we should also print out the signature of the original definition if we can't pinpoint the error to an incompatible argument/return type (that is, when we give the generic Signature of "x" incompatible with supertype "A" error).

Follow-up to #5025.

@ilevkivskyi
Copy link
Member

ilevkivskyi commented May 9, 2019

I think just printing the signature would be better IMO. In other places (bad keyword argument IIRC) we put notes "blah" defined here, but they are not always clear, and previously caused troubles in incremental mode and/or if output is sorted by file.

@JukkaL
Copy link
Collaborator Author

JukkaL commented May 9, 2019

The sounds reasonable. Alternatively, we could implement a more robust way of pointing to lines elsewhere in the target program.

@AlexWaygood AlexWaygood added topic-inheritance Inheritance and incompatible overrides topic-error-reporting How we report errors labels Mar 29, 2022
@hauntsaninja
Copy link
Collaborator

I think we have better error messages here now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-1-normal topic-error-reporting How we report errors topic-inheritance Inheritance and incompatible overrides topic-usability
Projects
None yet
Development

No branches or pull requests

4 participants