-
Notifications
You must be signed in to change notification settings - Fork 16
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
private vars need to be excluded consistently #33
Comments
After playing around a bit with different versions of Given this file: trait Foo {
private var x = 5
var y = 7
}
class Blah {
private var x = 5
var y = 7
}
class Bippy extends Foo if you compile with scala 2.9.3, and then use
but
We could change the rule used for finding a name match here https://github.com/quantifind/Sumac/blob/master/core/src/main/scala/com/quantifind/sumac/FieldArgs.scala#L50 to check for something that endsWith "$$_$eq" instead, but I worry that will be brittle. I think I'd only be willing to make that change if we find it somewhere in the scala spec ... |
actually, after a bit more thought, the name mangling makes perfect sense. private fields can have name clashes, but public ones can't. so maybe this is in the spec somewhere ... |
Just deleted a comment that made no sense ... (I see that there is a |
Excluding private does not work consistently right now. I have a feeling that its just not possible to do this correctly, because of the fact that we're looking at scala vars through java reflection. Which means we should just never try to exclude fields b/c they are private. (If we could consistently exclude private fields, then that would be better.)
Basically, it works for fields defined in a class, but not traits:
I'm not sure if this was always broken, or if it happened with the upgrade to 2.10 and we didn't notice it, or if it was a code change. (I don't think it was a code change.)
The text was updated successfully, but these errors were encountered: