From 19ab7ab10fabe7113f45063ffd2b6cc6abcc3329 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 6 Sep 2016 13:20:39 +0200 Subject: Make inline annotation @scala.inline. Drop @dotty.annotation.inline. This will inline all @inline marked methods in Scala for which a body is known (i.e. that are either compiled in the same run or have Tasty trees available). Option -Yno-inline suppresses inlining. This is needed for the moment because some @inline methods access private members or members that are otherwise inaccessible at the call-site. Also fixes some problems in Inliner - make sure type arguments to inline calls re fully defined - don't forget recursive calls in typeMap - don't forget positions in treeMap - drop dead code dealing with outer. --- tests/run/inlinedAssign.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/run/inlinedAssign.scala') diff --git a/tests/run/inlinedAssign.scala b/tests/run/inlinedAssign.scala index 735158209..b9a5d287d 100644 --- a/tests/run/inlinedAssign.scala +++ b/tests/run/inlinedAssign.scala @@ -1,6 +1,6 @@ object Test { - @dotty.annotation.inline + @inline def swap[T](x: T, x_= : T => Unit, y: T, y_= : T => Unit) = { val t = x x_=(y) @@ -10,8 +10,8 @@ object Test { def main(args: Array[String]) = { var x = 1 var y = 2 - @dotty.annotation.inline def setX(z: Int) = x = z - @dotty.annotation.inline def setY(z: Int) = y = z + @inline def setX(z: Int) = x = z + @inline def setY(z: Int) = y = z swap[Int](x, setX, y, setY) assert(x == 2 && y == 1) } -- cgit v1.2.3