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
new approach to field publicizing in Inliner #1133
new approach to field publicizing in Inliner #1133
Conversation
Started jenkins job pr-rangepos at https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/198/ |
Started jenkins job pr-scala-testsuite-linux-opt at https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/904/ |
jenkins job pr-scala-testsuite-linux-opt: Failed - https://scala-webapps.epfl.ch/jenkins/job/pr-scala-testsuite-linux-opt/904/ |
jenkins job pr-rangepos: Failed - https://scala-webapps.epfl.ch/jenkins/job/pr-rangepos/198/ |
Any chance for tests? We really need inliner tests and we have infrastructure to write them now (see 4caa766). |
val calleeSym = m.symbol | ||
if(hasInline(calleeSym)) { | ||
if(currentRun.compiles(f)) { | ||
toBecomePublic ::= f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should already be public after superaccessors, no? If so, why add them to toBecomePublic? I'd rather do assert(f.isPublic /* or whatever the incantation is*/)
.
And as Greg pointed out, I'd love to see some tests for it. |
As I said I'm focusing first on finding out what's wrong with the approach, tests afterwards. Looking at the conditions under which
The following assertion should hold on entry to
I'll check whether it actually holds. Probably not, because on second thought, I guess #1121 should have been stated as follows:
WDYT? |
You're right, it probably doesn't hold, but for a completely different reason -- the entry might be protected instead of private. I think the check should be Regarding the patch in #1121, you're right, it should check it's in the same compilation unit, else it will over-approximate the fields that are public. |
The following reformulation of #1121 seems all we can do in ExplicitOuter:
Better yet, the idea of |
I didn't follow the member public-izing problem closely, so I don't exactly know all the aspects. Why do you do:
? |
That pre-existed publicizing-for-inlining, it's there so that after flatten has run, accesses from an inner-class reaching out to outer members also work once the inner-class isn't an inner class anymore (after flattten). |
WIP: The above seems to work, yet doesn't quite do what we want: there are outer fields accessed in at-inline methdos that reach Inliner being private. |
Thanks for the clarification Miguel. |
Reworked version derived from
https://groups.google.com/d/topic/scala-internals/iPkMCygzws4/discussion
In particular,
https://groups.google.com/d/msg/scala-internals/iPkMCygzws4/LZHydgSjFSUJ
https://groups.google.com/d/msg/scala-internals/iPkMCygzws4/vEjJ4unAoFEJ
https://groups.google.com/d/msg/scala-internals/iPkMCygzws4/MIDPK6-3vwMJ
review by @VladUreche
Comments on performance impact are welcome /cc @gkossakowski