-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Name mangling has outstripped the abilities of lonesome '$' #2806
Comments
Imported From: https://issues.scala-lang.org/browse/SI-2806?orig=1 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@soc said (edited by @milessabin on Jun 22, 2016 2:34:48 PM UTC): scala> class A_+
defined class A_$plus
scala> class A_ { class plus }
defined class A_
scala> val a = new A_
a: A_ = A_@35235feb
scala> new a.plus
res1: a.plus = A_$plus@66176ccc |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
recent discussion in this area, in the Dotty repo: scala/scala3#5936 it seems rather unlikely that Scala 2 will see any further change in this area, unless it comes in 2.14 as part of an overall scalac/dotc alignment effort |
I think if I set my mind to it I could construct a lot more examples than this, but any number of collisions are too many. Is there any other character which could be utilized during mangling? It looks like this situation may improve in the future, as somewhat discussed here:
http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vm
Regardless, I think it would be worth figuring out something better which works on java 5. There's simply no way so many different things can be encoded with dollar signs and have it all come out clean in the wash.
This will give you a probably random choice of A_+ and A#plus in your A_$plus.class file.
See also #1994, where dragos says "This has to do with the mangling scheme for class protected members, which needs to be changed."
The text was updated successfully, but these errors were encountered: