Skip to content

Typer regression for dependant types in multiple OpenCB projects #23056

Closed
@WojciechMazur

Description

@WojciechMazur

Based on OpenCB failure for armanbilge/calico - build logs.
OpenCB for 3.7.1-RC1-bin-20250424-99d640c-NIGHTLY failed for more 45 projects then 3.7.1-RC1-bin-20250417-05b102a-NIGHTLY It's likely that most of these are coused by the same regression.
Similar errors were observed in at least 15 projects in both Typelevel and ZIO ecosystems as well as vanilla Scala.

Compiler version

Last good release: 3.7.1-RC1-bin-20250417-05b102a-NIGHTLY
First bad release: 3.7.1-RC1-bin-20250424-99d640c-NIGHTLY
Bisect points to 2f285a2

Minimized code

def Test = {
  val ops: CompileOps[Option, Option, Any]  = ???
  ops.to(List).map(_.reverse) // error
}

trait CompileOps[F[_], G[_], O]:
  def to(collector: Collector[O]): G[collector.Out]
trait Collector[-A] {
  type Out
}

object Collector:
  type Aux[A, X] = Collector[A] { type Out = X }
  
  given [A, C[_]]: Conversion[
    scala.collection.IterableFactory[C],
    Collector.Aux[A, C[A]]
  ] = ???

Output

-- [E007] Type Mismatch Error: /Users/wmazur/projects/scala/sandbox/test.scala:3:19 ---------------------------------------------------------------------------------------------------------
3 |  ops.to(List).map(_.reverse)
  |                   ^^^^^^^^^
  |                   Found:    ?1.Out => List[Any]
  |                   Required: ?2.Out => List[Any]
  |
  |                   where:    ?1 is an unknown value of type Collector.Aux[Any, List[Any]]
  |                             ?2 is an unknown value of type Collector.Aux[Any, List[Any]]

Expectation

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions