diff options
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/specialized.scala | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/library/scala/specialized.scala b/src/library/scala/specialized.scala index 8e30261333..fcc1c4b5da 100644 --- a/src/library/scala/specialized.scala +++ b/src/library/scala/specialized.scala @@ -3,7 +3,22 @@ package scala /** Annotate type parameters on which code should be automatically * specialized. For example: * <code> - * class MyList[T @specialized] ... + * 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). */ -class specialized extends StaticAnnotation +class specialized(types: String) extends StaticAnnotation { + def this() { + this("Boolean, Byte, Short, Char, Int, Long, Float, Double") + } +} + |