@@ -18,30 +18,35 @@ up on the [scala-lang](https://www.scala-lang.org) website. As an alternative, w
1818[ ` cs ` ] ( https://github.com/coursier/coursier ) (Coursier) to look up the information. Here's how to do it with ` cs ` :
1919
2020``` bash
21- $ cs complete-dep org.scala-lang:scala3-compiler_3:
21+ $ cs complete-dep org.scala-lang:scala3-compiler_3: | grep -v RC
22223.0.0
23- 3.0.1-RC1
24- 3.0.1-RC1-bin-20210413-f3c1468-NIGHTLY
25- 3.0.1-RC1-bin-20210415-59ea58e-NIGHTLY
26- 3.0.1-RC1-bin-20210416-8086e4b-NIGHTLY
27- .
28- .
29- .
23+ 3.0.1
24+ 3.0.2
25+ 3.1.0
26+ 3.1.1
27+ 3.1.2
28+ 3.1.3
29+ 3.2.0
30+ 3.2.1
31+ 3.2.2
32+ 3.3.0
33+ 3.3.1
3034```
3135
3236Now that you've figured out what the most recent version of the Scala 3 compiler is,
3337adapt the build to utilise this version (change ` code/build.sbt ` ).
3438
3539As we need to have a look at the options supported by the Scala 3 compiler, we need to install
3640the compiler first. Let's use Coursier to do this. For example, if we want to install version
37- 3.0.2 (which certainly isn't the most recent version at this moment...), we do this as follows:
41+ 3.3.0 (which certainly isn't the most recent version at this moment...), we do this as follows:
3842
3943``` bash
40- $ cs install scalac:3.0.2
44+ $ cs install scalac:3.3.0
45+ < elided>
4146Wrote scalac
4247
4348$ scalac -version
44- Scala compiler version 3.0.2 -- Copyright 2002-2021 , LAMP/EPFL
49+ Scala compiler version 3.3.0 -- Copyright 2002-2023 , LAMP/EPFL
4550```
4651
4752After having installed the compiler, we can have a look at its options.
@@ -52,38 +57,34 @@ from `scalac -help`. Note that the (reformatted) output you get from this comman
5257may be different if you installed a different version.
5358
5459``` bash
55- $ scalac -help
60+ $ scalac -- help
5661Usage: scalac < options> < source files>
5762where possible standard options include:
5863 -Dproperty=value Pass -Dproperty=value directly to the runtime system.
59- -J< flag> Pass < flag> directly to the runtime system.
60- -P Pass an option to a plugin, e.g. -P:< plugin> :< opt>
61- -V Print a synopsis of verbose options.
62- -W Print a synopsis of warning options.
6364...
64- < elided>
65+ < elided>
6566...
66- -new-syntax Require ` then` and ` do` in control expressions.
67- -old-syntax Require ` (...)` around conditions.
67+ -new-syntax Require ` then` and ` do` in control expressions.
68+ -indent Together with -rewrite, remove {...} syntax when possible
69+ due to significant indentation.
70+ -no-indent Require classical {...} syntax, indentation is not
71+ significant.
72+ -old-syntax Require ` (...)` around conditions.
73+ Default 80
74+ -rewrite When used in conjunction with a ` ...-migration` source
75+ version, rewrites sources to migrate to new version.
76+ (Scala.js only)
6877...
69- < elided>
78+ < elided>
7079...
71- -indent Together with -rewrite, remove {...} syntax when possible
72- due to significant indentation.
73- -no-indent Require classical {...} syntax, indentation is not
74- significant.
80+ -source source version
81+ Default 3.3
82+ Choices : 3.0-migration, 3.0, 3.1, 3.2-migration, 3.2,
83+ 3.3-migration, 3.3, future-migration, future
7584...
76- < elided>
85+ < elided>
7786...
78- -rewrite When used in conjunction with a ` ...-migration` source
79- version, rewrites sources to migrate to new version.
80- ...
81- < elided>
82- ...
83- -source source version
84- Default 3.2
85- Choices 3.0-migration, 3.0, 3.1, 3.2-migration, 3.2,
86- future-migration, future
87+ -source source version
8788```
8889
8990We will add some code that trigger a number of compiler warnings which can
@@ -108,8 +109,7 @@ Add the following code snippet to the `src/main/scala/org/lunatechlabs/dotty/sud
108109 root folder:
109110
110111``` scala
111- $ git add - A
112- $ git commit - m " Snapshot before Scala 3 compiler rewrite"
112+ $ git commit - a - m " Snapshot before Scala 3 compiler syntax rewrites"
113113```
114114
115115- Compile and investigate what the compiler reports.
0 commit comments