Skip to content

Failure to find implicit parameterized with F-bound #9764

Open
@scabug

Description

@scabug

The type-checker fails to find an implicit definition that has an F-bounded type parameter.
Here's a minimized example:

object Test {
  trait A[-T]
  trait B[-T]
  class C extends B[C]
  implicit def AfromB[T <: B[T]]: A[T] = null

  implicitly[A[C]]  // fails
  implicitly[A[C]](AfromB[C]) // ok if argument is given explicitly
}

Dotty compiles this OK. The example came up in an attempt to provide multiversal equality for Scala.

Metadata

Metadata

Assignees

Labels

f-boundsfixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)infer

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions