Skip to content

Issue a warning when an implicit view is resolved in -source:3.0-migration #9408

Closed
@adpi2

Description

@adpi2

Minimized example

trait Pretty {
  val print: String
}

object Pretty {
  def pretty[A](a: A)(implicit ev: A => Pretty): String = a.print
}

Output

The above code compiles with -source:3.0-migration but it does not issue a warning. This is an issue because in some cases the code compiles in both migration and standard modes but the runtime behavior is not the same. See below example:

trait Pretty {
  val print: String
}

object Pretty {
  implicit def prettyAny(any: Any): Pretty = new Pretty { val print = "" }
  def pretty[A](a: A)(implicit ev: A => Pretty): String = a.print
}

Expectation

In the migration mode, when an implicit view is resolved a warning should be issued.
The -language:implicitConversions option should not mute this warning.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions