Skip to content

Regression in mjakubowski84/parquet4s for type inference #21275

Closed
@WojciechMazur

Description

@WojciechMazur

Based on OpenCB failure in mjakubowski84/parquet4s - logs

Compiler version

Last good release: 3.4.0-RC1-bin-20231113-0dfe593-NIGHTLY
First bad release: 3.4.0-RC1-bin-20231114-18ada51-NIGHTLY
Bisect points to 6c556aa

Minimized code

// //> using dep "co.fs2::fs2-core:3.10.2"
sealed abstract class Pull[+F[_], +O, +R]:
  def >>[F2[x] >: F[x], O2 >: O, S](post: => Pull[F2, O2, S]): Pull[F2, O2, S]
object Pull:
  def eval[F[_], R](fr: F[R]): Pull[F, Nothing, R] = ???
  val done: Pull[Nothing, Nothing, Unit] = ???

class Test[F[_], T]:
  def dispose(path: String): F[Unit] = ???
  private def rotatePull(partitions: Iterable[String]): Pull[F, T, Unit] =
    partitions
      .map(partition => Pull.eval(dispose(partition)))
      .reduceOption(_ >> _)
      .getOrElse(Pull.done)

Output

-- [E007] Type Mismatch Error: /Users/wmazur/projects/sandbox/src/main/scala/usage.scala:14:16 
11 |    partitions
12 |      .map(partition => Pull.eval(dispose(partition)))
13 |      .reduceOption(_ >> _)
14 |      .getOrElse(Pull.done)
   |    ^
   |    Found:    Pull[F, Any, Unit]
   |    Required: Pull[F, T, Unit]
   |
   |    where:    F is a type in class Test with bounds <: [_] =>> Any
   |

Expectation

Should compile (probably)

Workaround:

Usage type parameter explicitly

.reduceOption[Pull[F, T, Unit]](_ >> _)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions