Skip to content

pat-map RecursionOverflow when F-bounded type parameter involved #9841

Closed
@Sciss

Description

@Sciss

Minimized code

trait Txn[T <: Txn[T]]

object Impl {
  sealed trait Entry[T <: Txn[T], A]
  case class EntrySingle[T <: Txn[T], A](term: Long, v: A)  extends Entry[T, A]
}

trait Impl[T <: Txn[T], K] {
  import Impl._

  def put[A](): Unit = {
    val opt: Option[Entry[T, A]] = ???
    
    opt match {
      case Some(EntrySingle(_, prevValue)) => ???   // crashes
      case _ =>
    }
  }
}

Output

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.
A recurring operation is (inner to outer):

  subtype LazyRef(uent / Compile / compileIncremental 3s
  de.sciss.lucre.confluent.Txn[
    LazyRef(
      de.sciss.lucre.confluent.Txn[
        LazyRef(
          de.sciss.lucre.confluent.Txn[
            LazyRef(

Expectation

Should work. Possibly related or the same underlying issue: #9631 , #9782

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions