Skip to content

Commit c86e69d

Browse files
committed
Address comments
1 parent 11dae6f commit c86e69d

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

docs/docs/reference/changed/eta-expansion-spec.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: doc-page
3-
title: "Automatic Eta Expansion"
3+
title: "Automatic Eta Expansion - More Details"
44
---
55

66
### Motivation
@@ -47,25 +47,6 @@ f1: (Boolean, String) => Int => List[Int]
4747
f2: Int => List[Int]
4848
```
4949

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-
6950
## Automatic eta-expansion and implicit parameter lists
7051

7152
Methods with implicit parameter lists will always get applied to implicit arguments.

docs/docs/reference/changed/eta-expansion.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,26 @@ f1: (Boolean, String) => Int => List[Int]
1717
f2: Int => List[Int]
1818
```
1919

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+
2041
[More details](eta-expansion-spec.html)
2142

0 commit comments

Comments
 (0)