Skip to content

Pattern match exhaustivity regression #18177

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
WojciechMazur opened this issue Jul 10, 2023 · 1 comment
Closed

Pattern match exhaustivity regression #18177

WojciechMazur opened this issue Jul 10, 2023 · 1 comment
Labels
area:pattern-matching itype:bug regression This worked in a previous version but doesn't anymore

Comments

@WojciechMazur
Copy link
Contributor

Regression found in Open CB for rescala-lang/rescala

Compiler version

Fails in 3.3.2-RC nightly
Fails in 3.3.1-RC3
Works in 3.3.0

Bisect points to 6b36cd9

Minimized code

//> using options -Xfatal-warnings

object core {
  trait ReSource {
    type State[_] = AnyRef
  }
  trait ReDerived extends ReSource

  object ReDerived {
    type of[S[_]] = ReDerived { type State[V] = S[V] }
  }
}

object Main {
  class TopoState[V]
  type State[V] <: TopoState[V]
  type ReDerived = core.ReDerived.of[State]

  val x: Option[ReDerived] = ???
  x match {
    case Some(value) => ???
    case None        => ???
  }
}

Output

Compiling project (Scala 3.3.1-RC3, JVM)
[error] ./bisect/main.scala:20:3
[error] match may not be exhaustive.
[error] 
[error] It would fail on pattern case: Some(_)
[error]   x match {
[error]   ^
Error compiling project (Scala 3.3.1-RC3, JVM)

Expectation

Should not trigger exhaustivity warning

@WojciechMazur WojciechMazur added itype:bug area:pattern-matching regression This worked in a previous version but doesn't anymore labels Jul 10, 2023
@dwijnand dwijnand changed the title Pattern match exhousitivty regression Pattern match exhaustivity regression Jul 10, 2023
@dwijnand
Copy link
Member

Duplicate of #17230

@dwijnand dwijnand marked this as a duplicate of #17230 Jul 11, 2023
@dwijnand dwijnand closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 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

No branches or pull requests

2 participants