summaryrefslogtreecommitdiff
path: root/test/files/run/constrained-types.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-10-14 17:34:54 +0000
committerPaul Phillips <paulp@improving.org>2010-10-14 17:34:54 +0000
commit185700607dc2fd12cf47a61f583bdbafd726558b (patch)
treede5ce98a84176042276101368c07cd828625b334 /test/files/run/constrained-types.scala
parent920449d6eeb0267f96b115a47866ccd53a5a3c55 (diff)
downloadscala-185700607dc2fd12cf47a61f583bdbafd726558b.tar.gz
scala-185700607dc2fd12cf47a61f583bdbafd726558b.tar.bz2
scala-185700607dc2fd12cf47a61f583bdbafd726558b.zip
Modification to the widening logic to treat loc...
Modification to the widening logic to treat locally defined symbols like final members thus allowing more constants to be inlined. Concretely, that means that in code like this: def f: Unit = { val b = false ; if (b) println("ok") } The call to println is no longer generated at all, and in this code: def f(x: Int) = { val X = 1 ; val Y = 2; x match { case X => 1 ; case Y => 2 } } A tableswitch is generated instead of the present if/then/else. I also added a big comment to the former widenIfNotFinal (now widenIfNecessary for obvious reasons.) Review by rytz.
Diffstat (limited to 'test/files/run/constrained-types.scala')
-rw-r--r--test/files/run/constrained-types.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/files/run/constrained-types.scala b/test/files/run/constrained-types.scala
index c03c144ad1..62abfe9e31 100644
--- a/test/files/run/constrained-types.scala
+++ b/test/files/run/constrained-types.scala
@@ -61,7 +61,7 @@ object Test {
| val x = "three"
| val y : String @Annot(x) = x
| y
- |} // x should be existentially bound""",
+ |} // x should not escape the local scope with a narrow type""",
"""def n(y: String) = {
| def m(x: String) : String @Annot(x) = {