Skip to content

Regression in kalin-rudnicki/harness  #19415

Closed
@WojciechMazur

Description

@WojciechMazur

Compiler version

3.4.0-RC1
First bad release: 3.3.2-RC1-bin-20230619-a68568c-NIGHTLY
Bisect points to b787d3c

Not affecting 3.3.2-RC1

Minimized code

def Test = {
  val left: Parser[String] = ???
  val right: Parser[Int] = ???
  val both = left && right

  val works = both.map(Ior.Both.apply)
  val fails = (left && right).map(Ior.Both.apply)
}

trait Parser[T]:
  final def &&[T2](other: Parser[T2])(implicit zip: Zip[T, T2]): Parser[zip.Out] = ???
  final def map[T2](f: T => T2): Parser[T2] = ???

infix trait Ior[+A, +B]
object Ior:
  final case class Both[+A, +B](a: A, b: B) extends (A Ior B)

trait Zip[In1, In2]:
  type Out

object Zip {
  type Out[In1, In2, O] = Zip[In1, In2] { type Out = O }
  implicit def zip2[_1, _2]: Zip.Out[_1, _2, (_1, _2)] = ???
}

Output

 |def Test = {
  |^
  |Recursion limit exceeded.
  |Maybe there is an illegal cyclic reference?
  |If that's not the case, you could also try to increase the stacksize using the -Xss JVM option.
  |For the unprocessed stack trace, compile with -Yno-decode-stacktraces.
  |A recurring operation is (inner to outer):
  |
  |  check fully defined A
  |  check fully defined (A, B)
  |  check fully defined Tuple.Elem[(A, B), (param)1]
  |  check fully defined A
  |  check fully defined (A, B)
  |  check fully defined Tuple.Elem[(A, B), (param)1]
  |  check fully defined A
  |  check fully defined (A, B)
  |  check fully defined Tuple.Elem[(A, B), (param)1]
  |  check fully defined A
  |  ...
  |
  |  check fully defined A
  |  check fully defined (A, B)
  |  check fully defined Tuple.Elem[(A, B), (param)1]
  |  check fully defined A
  |  check fully defined (A, B)
  |  check fully defined Tuple.Elem[(A, B), (param)1]
  |  check fully defined A
  |  check fully defined (A, B)
  |  check fully defined (A, B)
  |  check fully defined Tuple.Elem[(A, B), (param)1]
7 errors found
Compilation failed

Expectation

It probably should compile

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions