Skip to content

Implicit conversion warning when converting an Int to a Double #5360

Closed
@smarter

Description

@smarter

We probably should tone this down:

scala> val x: Double = (1: Int)
1 |val x: Double = (1: Int)
  |                 ^^^^^^
  |Use of implicit conversion method int2double in object Int should be enabled
  |by making the implicit value scala.language.implicitConversions visible.
  |This can be achieved by adding the import clause 'import scala.language.implicitConversions'
  |or by setting the compiler option -language:implicitConversions.
  |See the Scala docs for value scala.language.implicitConversions for a discussion
  |why the feature should be explicitly enabled.
val x: Double = 1.0

(Note that this cannot be observed in the dotty project itself because we globally enable -language:implicitConversions, which is another issue since it means we're blind to the pain these warnings cause)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reportingError reporting including formatting, implicit suggestions, etcitype:enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions