Skip to content

Regression in Scala 2.13.7 - cannot use wildcard for F-bounded type when using OptManifest #12481

Closed
scala/scala
#9806
@Sciss

Description

@Sciss

reproduction steps

using Scala 2.13.6 (and all before), the following works ( https://scastie.scala-lang.org/NkHsooECRGqIgttwtvkgMg )

trait Txn[T <: Txn[T]]

trait Universe[T <: Txn[T]]

object Ref {
  def apply[A](init: A)(implicit om: OptManifest[A]): Ref[A] = ???
}
trait Ref[A]

trait Handler {
  def all: Ref[Vector[Universe[_]]] = Ref(Vector.empty)   // here
}

In Scala 2.13.7, the marked line produces an error

type arguments [_$1] do not conform to trait Universe's type parameter bounds [T <: Txn[T]]
      def all: Ref[Vector[Universe[_]]] = Ref(Vector.empty)

This is somehow caused by the OptManifest argument to the Ref constructor. If I remove that implicit argument, it compiles again.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions