Skip to content

Spurious Warning for Type Being Inferred As Any #11798

@adamgfraser

Description

@adamgfraser
object Example {

  trait ZIO[-R, +E, +A]
  type Task[A] = ZIO[Any, Throwable, A]

  trait ZStream[-R, +E, +A] {
    def mapM[R1 <: R, E1 >: E, B](f: A => ZIO[R1, E1, B]): ZStream[R1, E1, B] =
      ???
  }

  val stream: ZStream[Any, Throwable, Int] = ???
  def f(n: Int): Task[Int] = ???
  stream.mapM(f) // a type was inferred to be `Any`; this may indicate a programming error.
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions