Skip to content

Regression in gekomad/itto-csv #16654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
WojciechMazur opened this issue Jan 10, 2023 · 3 comments · Fixed by #18043
Closed

Regression in gekomad/itto-csv #16654

WojciechMazur opened this issue Jan 10, 2023 · 3 comments · Fixed by #18043
Assignees
Labels
area:match-types itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@WojciechMazur
Copy link
Contributor

WojciechMazur commented Jan 10, 2023

https://scala3.westeurope.cloudapp.azure.com/job/buildCommunityProject/38542/

Scala version: 3.2.2-RC2

Bisect points to 46e3d77

Reproducer:

def toCsvFlat[A <: Product](a: A)(using m: scala.deriving.Mirror.ProductOf[A]) = {
  def flatTuple(any: Any): Tuple = any match
    case p: Product => p.productIterator.map(flatTuple).foldLeft(EmptyTuple: Tuple)(_ ++ _)
    case a          => Tuple1(a)
    
  val tuple = flatTuple(Tuple.fromProductTyped(a)).toList
}

Output:

-- [E007] Type Mismatch Error: /workspace/bisect/test.scala:6:51 ---------------
6 |  val tuple = flatTuple(Tuple.fromProductTyped(a)).toList
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |Found:    List[Tuple.Union[(?1 : Tuple)]]
  |Required: List[
  |  Tuple match {
  |    case EmptyTuple => Nothing
  |    case h *: t => h | scala.Tuple.Fold[t, Nothing, [x, y] =>> x | y]
  |  }
  |]
  |
  |where:    ?1 is an unknown value of type Tuple
  |
  |
  |Note: a match type could not be fully reduced:
  |
  |  trying to reduce  Tuple.Union[(?1 : Tuple)]
  |  trying to reduce  scala.Tuple.Fold[(?1 : Tuple), Nothing, [x, y] =>> x | y]
  |  failed since selector  (?1 : Tuple)
  |  does not match  case EmptyTuple => Nothing
  |  and cannot be shown to be disjoint from it either.
  |  Therefore, reduction cannot advance to the remaining case
  |
  |    case h *: t => h | scala.Tuple.Fold[t, Nothing, [x, y] =>> x | y]
  |
@WojciechMazur
Copy link
Contributor Author

@Kordyjan regression in the 3.2.2-RC2 build

@WojciechMazur WojciechMazur added itype:bug regression This worked in a previous version but doesn't anymore stat:needs triage Every issue needs to have an "area" and "itype" label labels Jan 10, 2023
@nicolasstucki
Copy link
Contributor

Related to #16583

@Kordyjan Kordyjan added area:match-types and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jan 11, 2023
@Kordyjan Kordyjan added this to the 3.3.1-RC1 milestone Jan 11, 2023
@odersky
Copy link
Contributor

odersky commented Jan 14, 2023

See: #16583 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:match-types itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
6 participants