From 9b6bb3306e072d65680dba8999c2b189b8b7a81d Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Tue, 15 Jan 2013 18:35:06 +0100 Subject: [PATCH] Correct description of ClassfileAnnotation --- overviews/reflection/annotations-names-scopes.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/overviews/reflection/annotations-names-scopes.md b/overviews/reflection/annotations-names-scopes.md index c4befce68b..3286473973 100644 --- a/overviews/reflection/annotations-names-scopes.md +++ b/overviews/reflection/annotations-names-scopes.md @@ -24,11 +24,13 @@ have been persisted, so that they can be read from the classfile containing the annotated declarations. A custom annotation type can be made persistent by inheriting from `scala.annotation.StaticAnnotation` or `scala.annotation.ClassfileAnnotation`. As a result, instances of the -annotation type are stored either as special attributes in the corresponding -classfile (`StaticAnnotation`) or as a Java annotation -(`ClassfileAnnotation`). Note that subclassing just +annotation type are stored as special attributes in the corresponding +classfile. Note that subclassing just `scala.annotation.Annotation` is not enough to have the corresponding metadata -persisted for runtime reflection. +persisted for runtime reflection. Moreover, subclassing +`scala.annotation.ClassfileAnnotation` does not make your annotation visible +as a Java annotation at runtime; that requires writing the annotation class +in Java. The API distinguishes between two kinds of annotations: