Reading the Value Classes and Universal Traits post, I looked at the RichInt example.
But, I changed the self field to leave off the val.
scala> class RichInt(self: Int) extends AnyVal {
| def toHexString: String = java.lang.Integer.toHexString(self)
| }
<console>:7: error: value class parameter must be a val and not be private[this]
class RichInt(self: Int) extends AnyVal {
^
I got a compile-time error. It appears that omitting the val results in the field have accessibility of private[this].
What's the significance of keeping versus excluding val? I'm not sure what must be a val actually means.