Closed
Description
Compiler version
3.0.0-RC3
Minimized code
case class Monad[A](v: A):
def map[B](f: A => B): Monad[B] = flatMap(a => Monad(f(a)))
def flatMap[B](f: A => Monad[B]): Monad[B] = ???
object Test {
for
x <- Monad(42) // OK
yield x
for
given x <- Monad(42) // value withFilter is not a member of Monad[A]
yield x
}
Output
value withFilter is not a member of Monad[A]
where: A is a type variable with constraint >: (42 : Int)
Expectation
Successful compilation