aboutsummaryrefslogtreecommitdiff
path: root/docs/usage/migrating.md
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-10-06 18:11:11 +0200
committerGitHub <noreply@github.com>2016-10-06 18:11:11 +0200
commit10ff9494165210b22eb80e989fc10c3ebf393bae (patch)
treeca9fa2f142b8e06d681d65eaf5afa5b44c7d98fc /docs/usage/migrating.md
parenteaa7f1730aa9da0aa7e4b2c4e86fbcc3acf26131 (diff)
parent237ddc31ab0281f9f2cddf598fc5f9af50f91f06 (diff)
downloaddotty-10ff9494165210b22eb80e989fc10c3ebf393bae.tar.gz
dotty-10ff9494165210b22eb80e989fc10c3ebf393bae.tar.bz2
dotty-10ff9494165210b22eb80e989fc10c3ebf393bae.zip
Merge pull request #1555 from felixmulder/topic/docs
Migrate wiki to docs dir
Diffstat (limited to 'docs/usage/migrating.md')
-rw-r--r--docs/usage/migrating.md46
1 files changed, 46 insertions, 0 deletions
diff --git a/docs/usage/migrating.md b/docs/usage/migrating.md
new file mode 100644
index 000000000..d835aeea6
--- /dev/null
+++ b/docs/usage/migrating.md
@@ -0,0 +1,46 @@
+---
+layout: default
+title: "Migrating to Dotty"
+---
+
+Migrating to Dotty
+==================
+
+### Minor tweaks ###
+ * `sym.linkedClassOfClass` => `sym.linkedClass`
+ * `definitions` => `ctx.definitions`
+
+### Member Lookup ###
+`tpe.member(name)` and `tpe.decl(name)` now return a `Denotation`, not a
+`Symbol`. If no definition is found they return `NoDenotation` (instead of
+`NoSymbol`).
+
+### Symbol Properties ###
+Most `sym.isProperty` methods don't exist in dotc, test for flags instead. See
+[dotc vs scalac: Trees, Symbols, Types & Denotations]
+
+### Logging, Error Reporting, Failures ###
+
+There are various kinds of logging:
+ * Errors, warnings, etc: `ctx.inform`, `ctx.warning`, `ctx.error`, ...
+ * Log messages displayed under `-Ylog:phase`: `log(msg)` in scalac =>
+ `ctx.log(msg)` in dotc
+ * Debug-Log messages displayed under `-Ydebug -Ylog:<phase>`: `debuglog(msg)`
+ in scalac => `ctx.debuglog(msg)` in dotc
+ * Assertions: `assert(invariant)`
+ * Fatal errors: `abort(msg)` in scalac => `throw new
+ dotty.tools.dotc.FatalError(msg)` in dotc
+
+
+#### During development / debugging ####
+Instead of `Predef.println`, use `dotc.config.Printers.somePrinter.println`
+[Printers.scala]. Printers can be easily added, enabled and disabled
+without changing command line arguments.
+
+```scala
+val default: Printer = new Printer // new Printer => print
+val core: Printer = noPrinter // noPrinter => shut up
+```
+
+[dotc vs scalac: Trees, Symbols, Types & Denotations]: https://github.com/lampepfl/dotty/wiki/dotc-vs-scalac:-Trees,-Symbols,-Types-&-Denotations
+[Printers.scala]: https://github.com/lampepfl/dotty/blob/master/src/dotty/tools/dotc/config/Printers.scala