summaryrefslogtreecommitdiff
path: root/test/files/run/t6331b.check
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-09-08 18:37:59 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-09-08 18:47:49 +0200
commitc619f94a9cfbddc12c9c5df3affb4636f8982a0a (patch)
tree8f0b988c9ab4cdb10723118453a4bda76d753457 /test/files/run/t6331b.check
parent5b9b394d99bd7e4446e0f15475b34ec287d91685 (diff)
downloadscala-c619f94a9cfbddc12c9c5df3affb4636f8982a0a.tar.gz
scala-c619f94a9cfbddc12c9c5df3affb4636f8982a0a.tar.bz2
scala-c619f94a9cfbddc12c9c5df3affb4636f8982a0a.zip
SI-6331 Avoid typing an If tree with a constant type.
The fast path in typedIf added in 8552740b avoided lubbing the if/else branch types if they are identical, but this fails to deconst the type. This could lead to the entire if expression being replaced by a constant. Also introduces a new tool in partest for nicer checkfiles. // in Test.scala trace(if (t) -0d else 0d) // in Test.check trace> if (Test.this.t) -0.0 else 0.0 res: Double = -0.0
Diffstat (limited to 'test/files/run/t6331b.check')
-rw-r--r--test/files/run/t6331b.check30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/files/run/t6331b.check b/test/files/run/t6331b.check
new file mode 100644
index 0000000000..6ca09e3814
--- /dev/null
+++ b/test/files/run/t6331b.check
@@ -0,0 +1,30 @@
+trace> if (Test.this.t)
+ -0.0
+else
+ 0.0
+res: Double = -0.0
+
+trace> if (Test.this.t)
+ 0.0
+else
+ -0.0
+res: Double = 0.0
+
+trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???)
+ -0.0
+else
+ 0.0)
+res: Any = class scala.NotImplementedError
+
+trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???)
+ 0.0
+else
+ 0.0)
+res: Any = class scala.NotImplementedError
+
+trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???)
+ ()
+else
+ ())
+res: Any = class scala.NotImplementedError
+