Scala view application puzzler

前端 未结 5 1645
粉色の甜心
粉色の甜心 2021-02-04 09:20

Say we have the following two traits:

trait Foo[A] { def howMany(xs: List[A]) = xs.size }
trait Bar

And an implicit conversion from the second

5条回答
  •  一生所求
    2021-02-04 10:06

    This seems like a bug so my answers are:

    1. search for a simliar bug reported against the Scala compiler and if not found, report a new bug https://issues.scala-lang.org/
    2. that part of the spec doesn't seem to matter in this case as it doesn't talk about type inference
    3. doesn't make any sense to me

    PS. In 2.8.1 your workaround of adding the dummy method to Bar doesn't make it compile.

提交回复
热议问题