Skip to content

Fix implicit conversion warnings #5886

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 12 commits into from
Feb 11, 2019

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Feb 9, 2019

Implement feature warnings for implicit conversion use according to #4229
also for new style implicit conversions.

Change the doc comment for language.implicitConversion to explain why it is
needed for use site conversions.

Based on #5868

We need that for pretty printing, and generally, to distinguish
the two styles for implicits.
Align with usage elsewhere where a flag name normally applies to both
terms and types, and is qualified with Term or Type if we want only one half.
I get it that `toMessage` will give a more precise error message. But that's no
reason to hide the message obtained from `getMessage` completely.
Interpretation of what `implied` means is still missing.
Implied imports can only import implied definitions.
Regular imports can only import non-implied definitions.
The change of Implicit to be a common flag now caused
some breakage, which this commit fixes.
Add implied import entry to sidebar
Implement feature warnings for implicit conversion use according to scala#4229
also for new style implicit conversions.

Change the doc comment for languge.implicitConversion to explain why it is
needed for use site conversions.
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! ❤️

Commit Messages

We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).

Please stick to these guidelines for commit messages:

  1. Separate subject from body with a blank line
  2. When fixing an issue, start your commit message with Fix #<ISSUE-NBR>:
  3. Limit the subject line to 72 characters
  4. Capitalize the subject line
  5. Do not end the subject line with a period
  6. Use the imperative mood in the subject line ("Add" instead of "Added")
  7. Wrap the body at 80 characters
  8. Use the body to explain what and why vs. how

adapted from https://chris.beams.io/posts/git-commit

Have an awesome day! ☀️

@smarter
Copy link
Member

smarter commented Feb 9, 2019

Note that we enable -language:implicitConversions in the build of Dotty, so there's tons of warning we don't see when bootstrapping: https://github.com/lampepfl/dotty/blob/4a290839c826f098653bcff330e30f3118fc1495/project/Build.scala#L130

@odersky
Copy link
Contributor Author

odersky commented Feb 10, 2019

@smarter Let's drop -language:implicitConversions once we have full bootstrap. That's a good occasion to validate whether our warning criteria make sense.

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM

checkFeature(defn.LanguageModuleClass, nme.implicitConversions,
i"Use of implicit conversion ${conv.showLocated}", NoSymbol, posd.sourcePos)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

symToShow and clsSyms are not used.

@liufengyun liufengyun assigned odersky and unassigned liufengyun Feb 11, 2019
@odersky odersky merged commit 7ff971f into scala:master Feb 11, 2019
@allanrenucci allanrenucci deleted the change-implicit-conversions-2 branch February 11, 2019 16:35
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.

4 participants