Skip to content

No warning emitted with ImplicitConverter when language.implicitConversions is not imported #5351

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

Closed
Duhemm opened this issue Oct 31, 2018 · 0 comments

Comments

@Duhemm
Copy link
Contributor

Duhemm commented Oct 31, 2018

Defining a value of type ImplicitConverter doesn't emit a warning, like it does when defining an implicit conversion when scala.language.implicitConversions is not in scope.

object O {
  implicit def foo(x: Int): String = x.toString // Emits a warning
  implicit val bar: ImplicitConverter[Int, String] = _.toString // No warning
}

Is this intentional?

Duhemm added a commit to dotty-staging/dotty that referenced this issue Nov 1, 2018
As we do for implicit conversions, we now emit a warning when an
implicit conversion using `ImplicitConverter` is defined or used.

Fixes scala#5351
odersky added a commit that referenced this issue Nov 1, 2018
Fix #5351: Warn about implicit conversions using ImplicitConverter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant