lightbend / genjavadoc

A compiler plugin for generating doc’able Java source from Scala source
Other
58 stars 32 forks source link

Why is the field of a class translated into a method? #184

Closed GeTOUO closed 5 years ago

GeTOUO commented 5 years ago

The val and var fielrds in the case class are translated into methods. Why?

raboof commented 5 years ago

That's what val and var fields compile to: if you want to access them from Java, you would achieve that by calling those methods. I don't know why the Scala compiler does that, but it's not a genjavadoc issue - genjavadoc just shows it ;).