aboutsummaryrefslogtreecommitdiff
path: root/tests/run/inline
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-09-10 20:58:34 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-02 16:11:21 +0200
commitd575e585389b025d7b8056bcb43fea67dddd15d0 (patch)
tree657453c9e17f109e29ead11d52807d1e335930ae /tests/run/inline
parente93b7bfe770c8950a52d17bb0aebd3e0a5e93b3c (diff)
downloaddotty-d575e585389b025d7b8056bcb43fea67dddd15d0.tar.gz
dotty-d575e585389b025d7b8056bcb43fea67dddd15d0.tar.bz2
dotty-d575e585389b025d7b8056bcb43fea67dddd15d0.zip
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.
Diffstat (limited to 'tests/run/inline')
-rw-r--r--tests/run/inline/inlines_1.scala12
1 files changed, 5 insertions, 7 deletions
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
}