|
1 | 1 | # Todo List
|
2 | 2 | Differences between scalameta implementation and dotc.
|
3 | 3 |
|
4 |
| -- [ ] For comprehension in Synthetic section. |
5 |
| -- [ ] Implicit conversions in Synthetic section. |
6 |
| -- [ ] Record signature information in Symbols section. |
7 |
| -- [ ] Record access modifier information in Symbols section. |
8 |
| -- [x] Record all definitions in Symbols section. |
| 4 | +- Generally put all zero length method calls or arguments in Synthetics section |
| 5 | + - Pattern val defs -- [unapply|unapplySeq is zero-length] |
| 6 | + - For comprehensions -- [map|flatMap|withFilter|foreach etc is zero-length]. |
| 7 | + - Implicit conversions -- [span of Apply node is same as its single argument (which has a length)]. |
| 8 | + - Implicit arguments -- [span of argument is zero length]. |
| 9 | +- Record signature information in Symbols section. |
| 10 | +- Record access modifier information in Symbols section. |
9 | 11 |
|
10 |
| -## ValPatterns |
| 12 | +## Completed |
11 | 13 |
|
12 |
| -Val patterns are tricky due to desugaring before ExtractSemanticDB sees them. |
13 |
| - |
14 |
| -### Tuples |
15 |
| -```scala |
16 |
| -val (left, right) = (1, 2) |
17 |
| -``` |
18 |
| -desugars to |
19 |
| -```scala |
20 |
| -private[this] <synthetic> val $3$: (Int, Int) = Tuple2.apply[Int, Int](1, 2) |
21 |
| -val left: Int = this.$3$._1 |
22 |
| -val right: Int = this.$3$._2 |
23 |
| -``` |
24 |
| - |
25 |
| -### Product1 Pattern |
26 |
| -```scala |
27 |
| -val Some(number1) = Some(1) |
28 |
| -``` |
29 |
| -desugars to |
30 |
| -```scala |
31 |
| -val number1: Int = Some.apply[Int](1):Some[Int] @unchecked match { |
32 |
| - case Some.unapply[Int](number1 @ _):Some[Int] => number1:Int |
33 |
| -} |
34 |
| -``` |
35 |
| - |
36 |
| -### ProductN Pattern |
37 |
| -```scala |
38 |
| -val x #:: xs = LazyList(1, 2) |
39 |
| -``` |
40 |
| -desugars to |
41 |
| -```scala |
42 |
| -private[this] <synthetic> val $2$: (Int, LazyList[Int]) = |
43 |
| - LazyList.apply[Int]([1,2 : Int]:Int*):LazyList[Int] @unchecked match { |
44 |
| - case #::.unapply[Int](x @ _, xs @ _):LazyList[Int] => Tuple2.apply[Int, LazyList[Int]](x, xs) |
45 |
| - } |
46 |
| -val x: Int = this.$2$._1 |
47 |
| -val xs: LazyList[Int] = this.$2$._2 |
48 |
| -``` |
49 |
| - |
50 |
| -perhaps it is safe to recognise these patterns if the binds were made synthetic. |
| 14 | +- [x] Recognise pattern val definitions. |
| 15 | +- [x] Recognise anonymous functions. |
| 16 | +- [x] Recognise specialised constant enum values. |
| 17 | +- [x] Use setter symbol when assigning to a var. |
| 18 | +- [x] Substitute constructor type params for the class parameters. |
| 19 | +- [x] Skip the synthetic import statement in an Enum class. |
| 20 | +- [x] Do not traverse RHS of synthetic val|var|def unless anonymous. |
| 21 | +- [x] Avoid symbols with volatile names. - [$1$, $2$, etc]. |
| 22 | +- [x] Skip module val |
| 23 | +- [x] Add metac printer. |
0 commit comments