summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2015-07-29 10:45:52 +0200
committerLukas Rytz <lukas.rytz@typesafe.com>2015-07-29 10:45:52 +0200
commita745f06e35e070061348e95725afb0def8ca45de (patch)
treef4f328c8c68455276b8a322c8c46efe07f72e61e /test/files/run
parent65fa73dff3e15f2d01b18c0528ac2dad6fe8e517 (diff)
parentec95e534a213a6ea760aa31c507d122ce449890a (diff)
downloadscala-a745f06e35e070061348e95725afb0def8ca45de.tar.gz
scala-a745f06e35e070061348e95725afb0def8ca45de.tar.bz2
scala-a745f06e35e070061348e95725afb0def8ca45de.zip
Merge pull request #4670 from retronym/ticket/9422
SI-9422 Fix incorrect constant propagation
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t9422.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/t9422.scala b/test/files/run/t9422.scala
new file mode 100644
index 0000000000..5ca2e8daaa
--- /dev/null
+++ b/test/files/run/t9422.scala
@@ -0,0 +1,11 @@
+class Test(val x: Long) {
+ def sameDirection(y: Long): Boolean =
+ (y == 0 || x == 0 || ((y > 0) == (x > 0)))
+}
+
+object Test {
+ def main(args: Array[String]) {
+ val b = new Test(1L)
+ assert(!b.sameDirection(-1L))
+ }
+}