You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following issues encountered when compiling Scala 2 code as-is under Dotty:
3
+
4
+
## Scalafix candidates
5
+
- If a method is defined `toSet()`, it cannot be called `toSet`.
6
+
- “result type of implicit definition needs to be given explicitly”
7
+
- There are no `'Symbol`s in Scala 3, you must construct symbols via `new Symbol("foo")` instead of old `'foo`
8
+
9
+
## 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`.
12
+
- Feature warnings about implicits `scala.language.implicitConversions` are output by default, unlike in Scala 2. This creates noise. Unclear how to turn off.
Stronger compile time guarantees on variance. Scala 2 does not assert variance on default parameters to parameters of the function value type. E.g. in geny:
23
+
24
+
```Scala
25
+
#Dotty
26
+
defcount(f: A=>Boolean= (a: A) =>true):Int=
27
+
|^^^^^^^^^^^^^^
28
+
|covariant typeA occurs in contravariant position in type=>A=>Boolean of method count$default$1
29
+
```
30
+
31
+
Fix:
32
+
```Scala
33
+
#Dotty
34
+
defcount[B>:A](f: B=>Boolean= (_: B) =>true):Int=
35
+
```
36
+
37
+
## Tricky
38
+
- Scala 3 macros are completely different from Scala 2 ones, requires a migration strategy of its own
0 commit comments