From 8e3240b43a839506c71c8793f4d904c089918389 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Wed, 18 Feb 2015 15:54:52 +0100 Subject: 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 --- tests/pos/Labels.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/pos') 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 + } + + } -- cgit v1.2.3