-
-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
832accf
commit 7312742
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## WIP Scala 3 support via Scala 2.13 / 3 compatibility | ||
|
||
Relies on the `compiler` module introduced in https://github.com/lihaoyi/Ammonite/pull/1144. | ||
|
||
Run with | ||
```text | ||
$ ./mill -i 'amm[3].run' | ||
``` | ||
|
||
Only Scala `3.0.0-M1` works for now, as it's the only Scala 3 version that can both depend on and | ||
be depended upon by Scala `2.13.4` modules. (The [Tasty reader version](https://github.com/lampepfl/dotty/blob/353677355f3a5ffe38b9abb31f07e61fbb37f50b/tasty/src/dotty/tools/tasty/TastyFormat.scala#L266-L267) | ||
is the same for both `2.13.4` and `3.0.0-M1`. It was incremented in `3.0.0-M2` and `3.0.0-M3`, which | ||
prevents `2.13.4` to read their Tasty files.) | ||
|
||
pprint wasn't published for `3.0.0-M1`, so we use the `2.13` version. We can't use the | ||
`TPrint` macros from Scala 3 because of that, so types are printed as `???`. Simple | ||
unit tests (like `./mill 'amm.repl[3].test' ammonite.session.AdvancedTests.pprint`) pass, | ||
thanks to a regex replacing types in the test fixtures with `???`. Not sure how far we | ||
can get with that approach. [Scala version decoupling](https://github.com/alexarchambault/Ammonite/tree/wip-scala-3) | ||
doesn't suffer that tasty reader version problem, so we can use `3.0.0-M2` fine for it. |