-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Replace ShortcutImplicits #8386
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
9a2e8ad
to
41cd7d1
Compare
@nicolasstucki @anatoliykmetyuk Could you investigate why the test disabled in 41cd7d1 fails? It seems to have nothing to do with the changes in this PR. |
Here's the failing test:
The test does not fail locally on my machine (either running sbt test) or executing the command by hand. |
I think I know what goes on. The command test
It looks for
So the correct way to set up the test is to use the output directory instead of SNAPSHOT-jar when searching for Alternatively, we could leave the test disabled and revive it again once [That also explains why the test worked locally: I have the output directory on the classpath, so it found the right |
So, this is ready for review now. |
OK, so this should work fine if |
41cd7d1
to
e8812b2
Compare
@smarter That seems to work, yes. At least locally it worked. Let's see what the CI says. |
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
* dependent refinements. Optionally returns a triple consisting of the argument | ||
* types `As`, the result type `B` and a whether the type is an erased context function. | ||
*/ | ||
object ContextFunctionType: |
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 think this object belongs at Types.scala
.
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.
One can debate this. I put it next to isContextFunctionType
and asContextFunctionType
, since it is related.
A re-implementation of the uncurrying part of erasure. It now goes "bottom-up" by temporarily admitting Apply's that dop not yet have all their arguments. The previous implementation was "top-down" by looking at the prototypes. # Conflicts: # compiler/src/dotty/tools/dotc/transform/Erasure.scala
Don't duplicate methods in ShortcutImplicits. Instead, always merge context function result parameters with normal parameters in one erased method, as long as the context functions were expanded as closures in the method's rhs. Om some cases (notably, but not exclusively, for bridges) this needs an eta expansion step at erasure. # Conflicts: # compiler/src/dotty/tools/dotc/core/NameKinds.scala # compiler/src/dotty/tools/dotc/transform/PostTyper.scala
Always use bootstrapped compiler for macro operations
a830325
to
923d591
Compare
The test in question was introduced by scala#8386. The test was failing on Java 11 from the very first time it was introduced. The first commit where `testCompilation context-functions` fails under Java 11 is cbd21a0.
Don't duplicate methods in ShortcutImplicits. Instead, always merge
context function result parameters with normal parameters in one erased
method, as long as the context functions were expanded as closures
in the method's rhs.
In some cases (notably, but not exclusively, for bridges) this needs
an eta expansion step at erasure.