Closed
Description
I'm currently adding Dotty support to ScalaSTM. Everything went smooth except that OptManifest
implicit compiler resolution seems broken (works through Scala 2.11–13).
Minimized code
We use the following API
object Ref {
def make[A: OptManifest]: Ref[A] = ???
}
trait Ref[A]
which is needed to distinguish between primitive types and reference types, and create arrays.
This works in the cases where the type is concrete, such as Ref.make[String]
or Ref.make[Int]
, but also when it is abstract such as
trait Foo[A] {
val bar = Ref.make[Int]
val baz: Ref[A] = Ref.make
}
Output
This no longer works in Dotty
[error] -- Error: /data/temp/dotty-optmanifest/src/main/scala/Foo.scala:2:25 -----------
[error] 2 | val bar = Ref.make[Int]
[error] | ^
[error] |no implicit argument of type OptManifest[Int] was found for an implicit parameter of method make in object Ref
[error] -- Error: /data/temp/dotty-optmanifest/src/main/scala/Foo.scala:3:28 -----------
[error] 3 | val baz: Ref[A] = Ref.make
[error] | ^
[error] |no implicit argument of type OptManifest[A] was found for an implicit parameter of method make in object Ref
[error] two errors found
Expectation
It should work, like it did in Scala 2.13, i.e. resolve to either ClassManifest
or NoManifest
. E.g.:
https://travis-ci.org/github/scala-stm/scala-stm/jobs/714280130