6

There are some constructs that don't have equivalents in java. Examples would be

  • named parameters
  • instance private members

Where/How does Scala store the information necessary for this stuff (some kind of flag in the first case, the parameter names in the second case?

If I get it right this has to get stored in the byte code, since it works even if I just have a compiled library without the source code!?

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348

1 Answers1

8

This information is captured in an annotation named ScalaSig in the class file (see this answer for an example).

You can view the (not very human-friendly) annotation with javap -verbose, or parse it using an internal API, but in general neither should be necessary.

Community
  • 1
  • 1
Travis Brown
  • 138,631
  • 12
  • 375
  • 680