-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixes to transparent functions #4881
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
Conversation
90707d5
to
9abda15
Compare
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.
Otherwise LGTM
case Some(x) => x > 1 || x == 1 && !boundSym.is(Method) | ||
case none => true | ||
} | ||
} && !boundSym.is(TransparentImplicitMethod) |
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.
it would be clearer and more performant if the conditions are inverted
!boundSym.is(TransparentImplicitMethod) &&
refCount.get(boundSym) match {
...
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.
I doubt the "more performant part" since the test isboundSym.is(TransparentImplicitMethod)
is ~99% likely to succeed. So it's better to put the test first that prunes more cases.
When adding implicit bindings to an implicit context of an inline body, we need to maintain the transparency of the implicits. The added implicit bindings are eliminated after inlining, since they are either unused or have been inlined.
If the result of reducing a projection has local bindings, these bindings need to be copied. Test case in run/Tuple.scala
Can't lift bindings from arguments as this might change evaluation order and it also does not work for cbn parameters. Also, fix stray printing
4b83e2e
to
8b941d6
Compare
I have put previously pushed subsequent commits in a separate PR, so that we can merge what was already approved. |
The end-goal is to have a nice implementation of tuples/hlists. A start is in Tuple.scala. This stresses transparent handling in interesting ways.