Skip to content

Commit 916b764

Browse files
authored
Merge pull request #3225 from lrytz/source-features
document -Xsource-features:eta-expand-always
2 parents 43a75c1 + 5b27cd0 commit 916b764

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_overviews/scala3-migration/tooling-scala2-xsource3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ The `-Xsource:3` flag enables the following Scala 3 syntaxes in Scala 2:
4646
- `import p.{given, *}`
4747
- `case C(xs*)` as an alias for `case C(xs @ _*)`
4848
- `A & B` type intersection as an alias for `A with B`
49-
- Selecting a method `x.f` performs an eta-expansion (`x.f _`), even without an expected type
5049

5150
## Scala 3 migration warnings in detail
5251

@@ -106,6 +105,7 @@ The following table shows backported Scala 3 language semantics available in `-X
106105
| `case-companion-function`: companions are Functions | fatal warning at use site | synthetic case companion objects no longer extend FunctionN, but are adapted at use site with warning |
107106
| `infer-override`: override type inference | fatal warning | inferred type of member uses type of overridden member |
108107
| `double-definitions`: definitions differing in empty parens <sup>2</sup> | fatal warning | double definition error |
108+
| `eta-expand-always`: `x.f` eta-expands (`x.f _`) even without an expected type | compilation error ("missing argument list") | `x.f` expands to a function value |
109109

110110
Example 1:
111111

@@ -125,7 +125,7 @@ class C(x: Int) {
125125

126126
### Changes affecting binary encoding
127127

128-
As of Scala 2.13.15, there are 3 changes in `-Xsource-features` that affect binary encoding of classfiles:
128+
As of Scala 2.13.17, there are 3 changes in `-Xsource-features` that affect binary encoding of classfiles:
129129

130130
1. `case-apply-copy-access`: the constructor modifiers of case classes (`case class C private[p] (x: Int)`) are copied to the synthetic `apply` and `copy` methods.
131131
1. `case-companion-function`: the synthetic companion objects of case classes no longer extend `FunctionN`.

0 commit comments

Comments
 (0)