Some identifiers generated internally by the Scala compiler contain the characters '$'. If you create new identifiers with $$ characters, you may encounter internally generated characters and chaos sets in. OTOH, you sometimes need the "$" characters, either on those (very rare) occasions when you need access to the internally generated Scala characters, or because someone used that identifier in the Java code that you want to call (where it's legal if also not recommended).
source share