Skip to content

No implicit argument of type F[T] was found (works in Scala 2) #15210

Open
@fdietze

Description

@fdietze

Compiler version

3.1.3-RC2

Minimized code

trait Observer[-T]
trait PublishSubject[A] extends Observer[A]

trait Source[H[_]] 
implicit object source extends Source[PublishSubject]


final def foo[F[_]: Source, T2 <: String](source: F[T2]) = ???
final def foo[F[_]: Source, T2 <: Option[String]](source: F[T2], dummy: Unit = ())  = ???


val x:PublishSubject[Option[String]] = ???
foo(x)

https://scastie.scala-lang.org/7HyQgDhzSgmRUO0mJPgPwA

Output

no implicit argument of type Playground.Source[Playground.Observer] was found for an implicit parameter of method foo in object Playground

Expectation

Should compile like in Scala 2.13

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions