You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// S1private int foo(int);
// S2
public final int S2$$$$foo(int);
I realize that in S2 a public method must be created so S2$$$$anonfun$$bar$$1 can access it, however I propose the original private method ought to be generated as well, simply forwarding to the public method.
This came up because I'm spending time porting various java tools to scala in parallel with working on a bytecode library. People use reflection in all manner of interesting ways, among them calling getDeclaredMethod (which considers private methods) expecting to find a method with the same name as the one in the source. Seems like a reasonable expectation.
I realize there will most likely be situations where scala bytecode can't be as predictable as java, however this doesn't like one of them.
The text was updated successfully, but these errors were encountered:
@hubertp said:
We are not really sure on how much good what make considering the amount of work to be put atm. I am closing, but if you have any ideas, more factors in favor of it (or eager to do it) then please reopen.
Consider these two classes:
And the generated code:
I realize that in S2 a public method must be created so S2$$$$anonfun$$bar$$1 can access it, however I propose the original private method ought to be generated as well, simply forwarding to the public method.
This came up because I'm spending time porting various java tools to scala in parallel with working on a bytecode library. People use reflection in all manner of interesting ways, among them calling getDeclaredMethod (which considers private methods) expecting to find a method with the same name as the one in the source. Seems like a reasonable expectation.
I realize there will most likely be situations where scala bytecode can't be as predictable as java, however this doesn't like one of them.
The text was updated successfully, but these errors were encountered: