We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.4.1
sealed trait T_A[A, B] type X = T_A[ Byte, Byte ] case class CC_B[A]( a: A ) extends T_A[A, X] val v_a: T_A[X, X] = CC_B(null) val v_b = v_a match { case CC_B(_) => 0 case _ => 1 }
The value of v_b is 0
The compiler gives an unreachable warning for case CC_B(_), so it should not be able to reach that case.
The text was updated successfully, but these errors were encountered:
The unreachable case indeed is reached when this similar repro is run:
// repro-script.sc sealed trait T_A[A, B] type X = T_A[ Byte, Byte ] case class CC_B[A]( a: A ) extends T_A[A, X] val v_a: T_A[X, X] = CC_B(null) val v_b = v_a match { case CC_B(_) => 0 case _ => 1 } println(s"unreachable case v_b: $v_b")
scala-cli run repro-script.sc Compiling project (Scala 3.4.2, JVM (17)) [warn] ./repro-script.sc:12:8 [warn] Unreachable case [warn] case CC_B(_) => 0 [warn] ^^^^^^^ Compiled project (Scala 3.4.2, JVM (17)) unreachable case v_b: 0
Sorry, something went wrong.
Very similar issues which were reported together with this, potentially duplicates:
dwijnand
Successfully merging a pull request may close this issue.
Compiler version
3.4.1
Minimized code
Output
The value of v_b is 0
Expectation
The compiler gives an unreachable warning for case CC_B(_), so it should not be able to reach that case.
The text was updated successfully, but these errors were encountered: