Skip to content

Commit 035cc6e

Browse files
Minor fixes of the documentation
Co-Authored-By: Guillaume Martres <[email protected]>
1 parent 4297802 commit 035cc6e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: docs/docs/contributing/debugging.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ object Playground {
2828

2929
Then, you can debug Dotty by compiling this file via `dotc ../issues/Playground.scala` (from the SBT console) and collecting various debug output in process. This section documents techniques you can use to collect the debug info.
3030

31-
[This](https://github.com/lampepfl/dotty/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/typer/Typer.scala#L2231) is the entry point to the Typer. The job of the Typer is to take an untyped tree, compute its type and turn it into a typed tree by attaching the type information to that tree (in an immutable way of course). We will use this entry point to practice debugging techniques. E.g.:
31+
[This](https://github.com/lampepfl/dotty/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/typer/Typer.scala#L2231) is the entry point to the Typer. The job of the Typer is to take an untyped tree, compute its type and turn it into a typed tree by attaching the type information to that tree. We will use this entry point to practice debugging techniques. E.g.:
3232

3333
```scala
3434
def typed(tree: untpd.Tree, pt: Type, locked: TypeVars)(implicit ctx: Context): Tree =
@@ -167,7 +167,7 @@ package <empty>@<Playground.scala:1> {
167167

168168
## Figuring out an object creation site
169169
### Via ID
170-
Every [Positioned](https://github.com/lampepfl/dotty/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/ast/Positioned.scala) (a trait of a `Tree`) object has `uniqueId` field. It is an integer that is unique for that tree and doesn't change from compile run to compile run. You can output these IDs from the printers (= from `show` and `-Xprint`) framework via `-Yshow-tree-ids` flag, e.g.:
170+
Every [Positioned](https://github.com/lampepfl/dotty/blob/10526a7d0aa8910729b6036ee51942e05b71abf6/compiler/src/dotty/tools/dotc/ast/Positioned.scala) (a parent class of `Tree`) object has a `uniqueId` field. It is an integer that is unique for that tree and doesn't change from compile run to compile run. You can output these IDs from any printer (such as the ones used by `.show` and `-Xprint`) via `-Yshow-tree-ids` flag, e.g.:
171171

172172
```
173173
dotc -Xprint:frontend -Yshow-tree-ids ../issues/Playground.scala
@@ -198,7 +198,7 @@ You can then use these IDs to locate the creation site of a given tree using tha
198198
dotc -Ydebug-tree-with-id 1049 ../issues/Playground.scala
199199
```
200200

201-
When requested what you want to do:
201+
When the tree with the correspond id is allocated, the following prompt will appear:
202202

203203
```
204204
Debug tree (id=1049) creation
@@ -208,7 +208,7 @@ Ident(Playground$)
208208
a)bort, s)tack, r)esume
209209
```
210210

211-
Input `s` for stack trace. You will get:
211+
If you input `s`, you will get a stack trace like this:
212212

213213
```
214214
java.lang.Throwable
@@ -294,7 +294,7 @@ if (tree.show == """println("Hello World")""") {
294294
```
295295

296296
## Built-in Logging Architecture
297-
Dotty has a lot of debug calls scattered throughout the code, vast majority of them disabled. At least three (possibly intertwined) architectures for logging are used for that:
297+
Dotty has a lot of debug calls scattered throughout the code, most of which are disabled by default. At least three (possibly intertwined) architectures for logging are used for that:
298298

299299
- Printer
300300
- Tracing

Diff for: docs/docs/contributing/scala2-vs-scala3.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ The following issues encountered when compiling Scala 2 code as-is under Dotty:
77
- There are no `'Symbol`s in Scala 3, you must construct symbols via `new Symbol("foo")` instead of old `'foo`
88

99
## Trivial
10-
- Scala 2.13 libraries cannot be used from Dotty, because the type signatures have Scala version `5.3` but `5.0` is expected.
11-
- To use Scala 2.12 dependencies from SBT with Dotty, explicitly suffix their names with `_2.12`.
10+
- Scala 2.13 libraries cannot be used from Dotty because the dotty-library is compiled against the 2.12 standard library which is not binary-compatible with the 2.13 one. We can't be compatible with both at the same time.
11+
- To use Scala 2.12 dependencies from SBT with Dotty, use `withDottyCompat` as documented [here](https://github.com/lampepfl/dotty-example-project#getting-your-project-to-compile-with-dotty).
1212
- Feature warnings about implicits `scala.language.implicitConversions` are output by default, unlike in Scala 2. This creates noise. Unclear how to turn off.
1313

1414
Implicit conversions must be applied explicitly:

0 commit comments

Comments
 (0)