aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/Labels.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-02-18 15:54:52 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-03-18 10:52:32 +0100
commit8e3240b43a839506c71c8793f4d904c089918389 (patch)
treeeb0a0de8ee3136c7c7421cdc02270f4aaeff3a17 /tests/pos/Labels.scala
parentab24bcf84d64e5d6fa2201056f70fe38a3260cc1 (diff)
downloaddotty-8e3240b43a839506c71c8793f4d904c089918389.tar.gz
dotty-8e3240b43a839506c71c8793f4d904c089918389.tar.bz2
dotty-8e3240b43a839506c71c8793f4d904c089918389.zip
Handle boxing inside labels, jump back to box.
Erasure inserts boxing and unboxing of label returned values, ignoring the fact that some labels do not return. Now this is taken into account also inside labels which refer labels themselves
Diffstat (limited to 'tests/pos/Labels.scala')
-rw-r--r--tests/pos/Labels.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/pos/Labels.scala b/tests/pos/Labels.scala
index 4a84175af..d82287313 100644
--- a/tests/pos/Labels.scala
+++ b/tests/pos/Labels.scala
@@ -1,3 +1,7 @@
+import dotty.tools.dotc.ast.Trees.Thicket
+import dotty.tools.dotc.ast.tpd._
+
+
object Labels {
def main(args: Array[String]): Unit = {
var i = 10
@@ -18,4 +22,17 @@ object Labels {
case t@2 => println("two" + t)
case _ => println("default")
}
+
+ def flatten(trees: Tree): Int = {
+ trees match {
+ case Thicket(elems) =>
+ while (trees ne trees) {
+ }
+ case tree =>
+ 33
+ }
+ 55
+ }
+
+
}