From d575e585389b025d7b8056bcb43fea67dddd15d0 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 10 Sep 2016 20:58:34 +0200 Subject: Make inline a keyword `inline` is now a modifier keyword. To keep disruption tolerable, we still allow `@inline` as an annotation as well. Other uses of `inline` are supported only under `-language:Scala2` and are rewritten to identifiers in backticks. --- tests/run/inline/inlines_1.scala | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'tests/run/inline') diff --git a/tests/run/inline/inlines_1.scala b/tests/run/inline/inlines_1.scala index 8189e6805..24f1c78fe 100644 --- a/tests/run/inline/inlines_1.scala +++ b/tests/run/inline/inlines_1.scala @@ -5,8 +5,7 @@ object inlines { final val monitored = false - @inline - def f(x: Int): Int = x * x + inline def f(x: Int): Int = x * x val hits = new mutable.HashMap[String, Int] { override def default(key: String): Int = 0 @@ -21,8 +20,7 @@ object inlines { @volatile private var stack: List[String] = Nil - @inline - def track[T](fn: String)(op: => T) = + inline def track[T](fn: String)(op: => T) = if (monitored) { stack = fn :: stack record(fn) @@ -34,9 +32,9 @@ object inlines { def f = "Outer.f" class Inner { val msg = " Inner" - @inline def m = msg - @inline def g = f - @inline def h = f ++ m + inline def m = msg + inline def g = f + inline def h = f ++ m } val inner = new Inner } -- cgit v1.2.3