- Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
The Scala spect states:
The ‘$’ character is reserved for compiler-synthesized identifiers. User programs should not define identifiers which contain ‘$’ characters.
Using such identifiers can easily lead to issues (including unsoundness). The last known occurrence of this issue happened in #18227. We had several prior bugs reported, all ended up with a link to the spec but no action on the compiler.
Unfortunately, the compiler does not enforce or warn about uses of these identifiers. Users are unlikely to learn about this obscure line in the middle of the spec.
We should warn the users if the use an identifier with $
s. We should not make it an error as there are some legitimate corner cases where $
in the source code is used (such as in the stdlib and for backward binary compact patches).