summaryrefslogtreecommitdiff
path: root/src/library/scala/specialized.scala
blob: e082c2cdfa81041438f676f3ebf7e40b8b7933f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2009, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

// $Id$


package scala

/** Annotate type parameters on which code should be automatically
 *  specialized. For example:
 *  <code>
 *    class MyList[@specialized T] ...
 *  </code>
 *
 *  Type T can be specialized on a subset of the primitive types by
 *  specifying a comma-separated string argument:
 *
 *  <code>
 *   class MyList[@specialized("Int, Double, Boolean") T] ..
 *  </code>
 *  Only primitive types are supported and no name resolution is currently
 *  done on the string arguments (meaning imports and type aliases are
 *  not resolved).
 *
 *  @since 2.8
 */
class specialized(types: String) extends StaticAnnotation {
  def this() {
    this("Boolean, Byte, Short, Char, Int, Long, Float, Double")
  }
}