Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dwijnand opened this issue Nov 14, 2022 · 2 comments · Fixed by #16526
Closed

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

dwijnand opened this issue Nov 14, 2022 · 2 comments · Fixed by #16526
Assignees
Labels
area:pattern-matching itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@dwijnand
Copy link
Member

[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()
  }
}
@dwijnand dwijnand self-assigned this Nov 14, 2022
@dwijnand dwijnand changed the title rescala-lang/rescala v0.31.0 Regression in rescala-lang/rescala v0.31.0 Nov 14, 2022
@dwijnand dwijnand added itype:bug area:pattern-matching regression This worked in a previous version but doesn't anymore labels Nov 14, 2022
@dwijnand
Copy link
Member Author

Likely from #16168

@Kordyjan Kordyjan added this to the Future versions milestone Dec 12, 2022
dwijnand added a commit to dwijnand/scala3 that referenced this issue Dec 14, 2022
Not doing so, in a context where GADT inferrence is enabled, such as in
TypeOps.refineUsingParent, leads to false inferrences.

Doing so, and removing the previous fix for scala#15967, fixes the regression
in scala#16339, and keeps scala#15967 as well as scala#16123 (which is somewhat
related) fixed.
@dwijnand dwijnand linked a pull request Dec 15, 2022 that will close this issue
@WojciechMazur
Copy link
Contributor

@Kordyjan this regression is present in the 3.2.2-RC2 build

little-inferno pushed a commit to little-inferno/dotty that referenced this issue Jan 25, 2023
Not doing so, in a context where GADT inferrence is enabled, such as in
TypeOps.refineUsingParent, leads to false inferrences.

Doing so, and removing the previous fix for scala#15967, fixes the regression
in scala#16339, and keeps scala#15967 as well as scala#16123 (which is somewhat
related) fixed.
@Kordyjan Kordyjan modified the milestones: Future versions, 3.3.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:pattern-matching itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants