We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 333187a commit 93b7e29Copy full SHA for 93b7e29
test/junit/scala/tools/nsc/backend/jvm/opt/MethodLevelOptsTest.scala
@@ -741,4 +741,19 @@ class MethodLevelOptsTest extends ClearAfterClass {
741
GETSTATIC, LDC, "print",
742
-1, GOTO))
743
}
744
+
745
+ @Test
746
+ def booleanOrderingCompare(): Unit = {
747
+ val code =
748
+ """class C {
749
+ | def compare(x: Boolean, y: Boolean) = (x, y) match {
750
+ | case (false, true) => -1
751
+ | case (true, false) => 1
752
+ | case _ => 0
753
+ | }
754
+ |}
755
+ """.stripMargin
756
+ val List(c) = compileClasses(methodOptCompiler)(code)
757
+ assertNoInvoke(getSingleMethod(c, "compare"))
758
+ }
759
0 commit comments