Skip to content

Regression in rescala-lang/rescala v0.31.0 #16339

Closed
@dwijnand

Description

@dwijnand
[error] -- [E029] Pattern Match Exhaustivity Error: /home/jenkins/agent/workspace/buildCommunityProject/repo/Code/Main/jvm/src/main/scala/rescala/fullmv/mirrors/Host.scala:88:30 
[error] 88 |      getCachedOrReceiveRemote(guid, new SubsumableLockReflection(this, guid, remoteProxy)) match {
[error]    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]    |      match may not be exhaustive.
[error]    |
[error]    |      It would fail on pattern case: mirrors.Instantiated(_)
[error]    |
[error]    | longer explanation available when compiling with `-explain`
[error] one error found
[error] (rescalaJVM / Compile / compileIncremental) Compilation failed
package rescala.fullmv.mirrors

sealed trait CacheResult[T, +U <: T] { val instance: T }
case class Found[T](instance: T)                extends CacheResult[T, Nothing]
case class Instantiated[T, U <: T](instance: U) extends CacheResult[T, U]
trait Host[T] {
  val dummy: T
  def getCachedOrReceiveRemote[U <: T](guid: Host.GUID, instantiateReflection: => U): CacheResult[T, U]
}

trait SubsumableLockHost extends Host[SubsumableLock] {
  def getCachedOrReceiveRemoteWithReference(guid: Host.GUID, remoteProxy: => SubsumableLockProxy): SubsumableLock = {
    @tailrec def retry(): SubsumableLock = {
      getCachedOrReceiveRemote(guid, new SubsumableLockReflection(this, guid, remoteProxy)) match {
        case Instantiated(instance) =>      instance
        case Found(instance) => ???
      }
    }
    retry()
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions