8000 Merge pull request #163 from phaller/patch-3 · rssh/scala.github.com@73d6e14 · GitHub
[go: up one dir, main page]

Skip to content

Commit 73d6e14

Browse files
committed
Merge pull request scala#163 from phaller/patch-3
Correct description of ClassfileAnnotation
2 parents b67e79d + 9b6bb33 commit 73d6e14

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

overviews/reflection/annotations-names-scopes.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ have been persisted, so that they can be read from the classfile containing
2424
the annotated declarations. A custom annotation type can be made persistent by
2525
inheriting from `scala.annotation.StaticAnnotation` or
2626
`scala.annotation.ClassfileAnnotation`. As a result, instances of the
27-
annotation type are stored either as special attributes in the corresponding
28-
classfile (`StaticAnnotation`) or as a Java annotation
29-
(`ClassfileAnnotation`). Note that subclassing just
27+
annotation type are stored as special attributes in the corresponding
28+
classfile. Note that subclassing just
3029
`scala.annotation.Annotation` is not enough to have the corresponding metadata
31-
persisted for runtime reflection.
30+
persisted for runtime reflection. Moreover, subclassing
31+
`scala.annotation.ClassfileAnnotation` does not make your annotation visible
32+
as a Java annotation at runtime; that requires writing the annotation class
33+
in Java.
3234

3335
The API distinguishes between two kinds of annotations:
3436

0 commit comments

Comments
 (0)
0