summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2016-06-02 18:53:04 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2016-06-02 23:30:40 -0700
commit5667ff46c134878e35edca1ff57b8007ebec4f9a (patch)
treeab5787c25841ab11534044d18a2eb34b8c8bb231 /src/library
parent461c896581a6e16d1b79e91e9322eb2d14dc53d2 (diff)
downloadscala-5667ff46c134878e35edca1ff57b8007ebec4f9a.tar.gz
scala-5667ff46c134878e35edca1ff57b8007ebec4f9a.tar.bz2
scala-5667ff46c134878e35edca1ff57b8007ebec4f9a.zip
Prohibit @native method in trait
On the JVM, a @native interface method results in a VerifyError. Other platforms could decide to be more permissive, but it seems like allowing them in classes is enough.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/native.scala9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/library/scala/native.scala b/src/library/scala/native.scala
index dbacc78618..49d3ced805 100644
--- a/src/library/scala/native.scala
+++ b/src/library/scala/native.scala
@@ -16,8 +16,11 @@ package scala
* @native def f(x: Int, y: List[Long]): String = ...
* }}}
*
- * Method body is not generated if method is marked with `@native`,
- * but it is type checked when present.
+ * A `@native` method is compiled to the platform's native method,
+ * while discarding the method's body (if any). The body will be type checked if present.
*
- * @since 2.6 */
+ * A method marked @native must be a member of a class, not a trait (since 2.12).
+ *
+ * @since 2.6
+ */
class native extends scala.annotation.StaticAnnotation {}