From 037d3dcbc5896864aec0f9121eeda23fcc4cd610 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Fri, 1 Jun 2012 18:44:40 +0200 Subject: Don't compute least upper bounds for expressions in statement positions inside blocks. This may save huge amount of time (Fixes SI-5862) for complicated lubs. I had to remove the a check in adapt for the part that transforms into { ; () } when the expected type is Unit. The reason is in the code. As a side effect, we get more warnings for pure expressions in statement positions (see the change in the test file). --- test/files/neg/checksensible.check | 4 ++-- test/files/neg/checksensible.scala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check index 23af94180a..772d58322d 100644 --- a/test/files/neg/checksensible.check +++ b/test/files/neg/checksensible.check @@ -77,8 +77,8 @@ checksensible.scala:63: error: comparing a fresh object using `!=' will always y new Exception() != new Exception() ^ checksensible.scala:66: error: comparing values of types Int and Null using `==' will always yield false - if (foo.length == null) "plante" else "plante pas" - ^ + val dummy = if (foo.length == null) "plante" else "plante pas" + ^ checksensible.scala:71: error: comparing values of types Bip and Bop using `==' will always yield false (x1 == x2) ^ diff --git a/test/files/neg/checksensible.scala b/test/files/neg/checksensible.scala index 27ee908153..15a9b6d9b6 100644 --- a/test/files/neg/checksensible.scala +++ b/test/files/neg/checksensible.scala @@ -63,7 +63,7 @@ class EqEqRefTest { new Exception() != new Exception() val foo: Array[String] = Array("1","2","3") - if (foo.length == null) "plante" else "plante pas" + val dummy = if (foo.length == null) "plante" else "plante pas" // final classes with default equals val x1 = new Bip -- cgit v1.2.3