From 185700607dc2fd12cf47a61f583bdbafd726558b Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 14 Oct 2010 17:34:54 +0000 Subject: 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. --- test/files/run/constrained-types.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/files/run/constrained-types.scala') 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) = { -- cgit v1.2.3