Skip to content

Check implicitNotFound annotations for invalid type variable references #9430

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
Aug 7, 2020

Conversation

YourPsychiatrist
Copy link

Implements the behavior requested in #4008.

Trees which are checked:

  • annotations on Templates (classes and traits)
  • annotations on implicit parameters of DefDefs (including constructors)

Copy link
Member

@dottybot dottybot left a comment

Choose a reason for hiding this comment

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

Hello, and thank you for opening this PR! 🎉

All contributors have signed the CLA, thank you! ❤️

Have an awesome day! ☀️

@YourPsychiatrist YourPsychiatrist marked this pull request as ready for review July 25, 2020 04:19
@YourPsychiatrist YourPsychiatrist force-pushed the check-implicit-annot-refs branch from 3fe124c to 9475519 Compare July 25, 2020 09:29
@smarter
Copy link
Member

smarter commented Jul 25, 2020

In your commit message "Closes #44008"" should be "Fixes #4408" to get github to automatically close the issue when the PR is merged.

@YourPsychiatrist YourPsychiatrist force-pushed the check-implicit-annot-refs branch 3 times, most recently from e2e292b to 61da3d2 Compare July 25, 2020 09:52
@som-snytt
Copy link
Contributor

NB IIRC scala2 checks this under -Xlint.

$ scalac -Xlint:help
  implicit-not-found      Check @implicitNotFound and @implicitAmbiguous messages.

@nicolasstucki nicolasstucki linked an issue Aug 4, 2020 that may be closed by this pull request
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

Sorry for the wait, this PR slipped my mind! Overall this looks nice, one extra remark: Dottydoc supports markdown, so it'd be nice to rewrite the comments to use that instead of wiki syntax.

@YourPsychiatrist YourPsychiatrist force-pushed the check-implicit-annot-refs branch 2 times, most recently from dbb9602 to 99c1362 Compare August 7, 2020 16:43
Both, annotated function arguments and annotated classes / traits,
are now checked for invalid type variable references and warn at
declaration site.
@YourPsychiatrist YourPsychiatrist force-pushed the check-implicit-annot-refs branch from 99c1362 to b177971 Compare August 7, 2020 17:32
@smarter smarter merged commit dfcc0b1 into scala:master Aug 7, 2020
@YourPsychiatrist YourPsychiatrist deleted the check-implicit-annot-refs branch August 10, 2020 05:19
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.

Warn when a user defined error message references undefined names
4 participants