scala3
scala3 copied to clipboard
Change Scala 2 compiler to accept `using` in argument clauses
We need to make progress on the translation of context bounds. A context bound currently translates to an implicit evidence parameter, but it should be a using clause. The best way to change this would be.
-
A deprecation phase, where we warn when an implicit parameter stemming from a context bound is instantiated with an explicitly passed, plain (non-using) argument. We should also have an option to rewrite this automatically.
-
After that, a change to the new behavior.
To make the deprecation phase compatible with the need to cross compile with Scala 2, we need to change the Scala 2 compiler to accept using clauses. See https://github.com/lampepfl/dotty/pull/15549#issuecomment-1170212699 for similar changes.
As a warm-up, I'll take a quick swing at this by choking up on the bat.
This is just to accept f(using x) without further checks.
Edit: I see the issue is on dotty repo.
Edit: idly wondering if it currently says: Did you mean Using?
Edit: sadly, it does not suggest, Did you mean Using?
The referenced PR is merged on Scala 2.
To follow up, "choking up on the bat" in American baseball just means holding the "bat" that is used to strike the ball a bit further up the shaft, thereby enabling a quicker swing that may also be more precise and effective.