-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Given that this only happens in Scala 3 I'm not sure if anything can be done in cats to fix it, but figured I'd start by reporting it here.
When using the tuple semigroupal syntax, e.g. (...).tupled or (...).mapN, constant types in the tuple are widened to their underlying type. For example:
import cats.syntax.apply._
val e1: Either[Unit, "a"] = Right("a")
val e2: Either[Unit, Int] = Right(1)
(e1, e2).tupled
// type is `Either[Unit, (String, Int)]`
// desired type is `Either[Unit, ("a", Int)]`Annotating the result with the desired type does work, but IMO it adds unwanted noise
// both of these compile
val x: Either[Unit, ("a", Int)] = (e1, e2).tupled
(e1, e2).tupled: Either[Unit, ("a", Int)]Metadata
Metadata
Assignees
Labels
No labels