File tree Expand file tree Collapse file tree 2 files changed +22
-20
lines changed
docs/docs/reference/changed Expand file tree Collapse file tree 2 files changed +22
-20
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
layout : doc-page
3
- title : " Automatic Eta Expansion"
3
+ title : " Automatic Eta Expansion - More Details "
4
4
---
5
5
6
6
### Motivation
@@ -47,25 +47,6 @@ f1: (Boolean, String) => Int => List[Int]
47
47
f2: Int => List [Int ]
48
48
```
49
49
50
- ## Automatic eta-expansion and nullary methods
51
-
52
- Automatic eta expansion does not apply to "nullary" methods that take an empty parameter list. Given
53
-
54
- ``` scala
55
- def next (): T
56
- ```
57
-
58
- A simple reference to ` next ` does not auto-convert to a function.
59
- One has to write explicitly ` () => next() ` to achieve that
60
- Once again since the ` _ ` is going to be deprecated it's better to write it this way
61
- rather than ` next _ ` .
62
-
63
- The reason for excluding nullary methods from automatic eta expansion
64
- is that Scala implicitly inserts the ` () ` argument, which would
65
- conflict with eta expansion. Automatic ` () ` insertion is
66
- [ limited] ( ../dropped/auto-apply.md ) in Dotty, but the fundamental ambiguity
67
- remains.
68
-
69
50
## Automatic eta-expansion and implicit parameter lists
70
51
71
52
Methods with implicit parameter lists will always get applied to implicit arguments.
Original file line number Diff line number Diff line change @@ -17,5 +17,26 @@ f1: (Boolean, String) => Int => List[Int]
17
17
f2: Int => List [Int ]
18
18
```
19
19
20
+ The syntax ` m _ ` is no longer needed and will be deprecated in the future.
21
+
22
+ ## Automatic eta-expansion and nullary methods
23
+
24
+ Automatic eta expansion does not apply to "nullary" methods that take an empty parameter list.
25
+
26
+ ``` scala
27
+ def next (): T
28
+ ```
29
+
30
+ Given a simple reference to ` next ` does not auto-convert to a function.
31
+ One has to write explicitly ` () => next() ` to achieve that
32
+ Once again since the ` _ ` is going to be deprecated it's better to write it this way
33
+ rather than ` next _ ` .
34
+
35
+ The reason for excluding nullary methods from automatic eta expansion
36
+ is that Scala implicitly inserts the ` () ` argument, which would
37
+ conflict with eta expansion. Automatic ` () ` insertion is
38
+ [ limited] ( ../dropped/auto-apply.md ) in Dotty, but the fundamental ambiguity
39
+ remains.
40
+
20
41
[ More details] ( eta-expansion-spec.html )
21
42
You can’t perform that action at this time.
0 commit comments