scala3 icon indicating copy to clipboard operation
scala3 copied to clipboard

Documentation: `any2stringadd` being blacklisted is not documented

Open neko-kai opened this issue 5 years ago • 3 comments

Minimized code

object App extends App {
  (??? : Any) + 1
}

Output

value + is not a member of Any, but could be made available as an extension method.

One of the following imports might make progress towards fixing the problem:

  import math.Fractional.Implicits.infixFractionalOps
  import math.Integral.Implicits.infixIntegralOps
  import math.Numeric.Implicits.infixNumericOps

Expectation

Expected to match Scala 2 behavior, however it seems the change is intentional, but undocumented:

https://github.com/lampepfl/dotty/blob/f26808e59da8d4e05cd54d496e684d00888cddd1/compiler/src/dotty/tools/dotc/typer/ImportInfo.scala#L32

neko-kai avatar Apr 29 '20 10:04 neko-kai