We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 159b3a8 commit 4bc3241Copy full SHA for 4bc3241
compiler/src/dotty/tools/dotc/util/NameTransformer.scala
@@ -48,6 +48,11 @@ object NameTransformer {
48
/** Replace operator symbols by corresponding expansion strings, and replace
49
* characters that are not valid Java identifiers by "$u" followed by the
50
* character's unicode expansion.
51
+ * Note that no attempt is made to escape the use of '$' in `name`: blindly
52
+ * escaping them might make it impossible to call some platform APIs. This
53
+ * unfortunately means that `decode(encode(name))` might not be equal to
54
+ * `name`, this is considered acceptable since '$' is a reserved character in
55
+ * the Scala spec as well as the Java spec.
56
*/
57
def encode(name: SimpleName): SimpleName = {
58
var buf: StringBuilder = null
0 commit comments