To test this, I used the following code and javap -v , just like you.
@Deprecated
at the very end, there is this conclusion:
SourceFile: "Test.scala" RuntimeVisibleAnnotations: 0:
Where #6 is @Deprecated and #7(#8=s#9) is @scala.reflect.ScalaSignature(bytes=...) . Thus, despite the fact that there are several methods, and the class has its own signature, there is only one ScalaSignature annotation, which encodes all the additional information of the signature in some binary format.
You already pointed to SID-10 in your answer, where it states that the signature is compressed (which is pretty obvious, given that there are no recognizable class names), and that the ScalaSig file ScalaSig was used for this before Scala 2.8. (The reason for the change is explained as the availability of reflection at runtime - (at least unknown) attributes are not saved by the JVM, annotations with proper preservation.)
Another thing to note is that while Scala signatures are a superset of Java signatures, Java signatures still need to be unique - the JVM does not care about Scala at runtime.
PS: this is also done in other JVM languages; one where I know that this is definitely the case of AspectJ. I think generics could be implemented in the same way, but it is not; they have their own encoding in the class file format.
source share