Skip to content

Commit 40490cb

Browse files
committed
Update markdown files for preprocessing purposes
1 parent 6a3cd1f commit 40490cb

File tree

123 files changed

+901
-562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+901
-562
lines changed
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: "Other Changed Features"
3+
type: chapter
4+
num: 51
5+
previous-page: /scala3/reference/other-new-features/type-test
6+
next-page: /scala3/reference/changed-features/numeric-literals
7+
---
8+
9+
The following pages document the features that have changed in Scala 3, compared to Scala 2.

docs/docs/reference/changed-features/compiler-plugins.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Changes in Compiler Plugins"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/compiler-plugins.html
3+
type: section
4+
num: 67
5+
previous-page: /scala3/reference/changed-features/eta-expansion
6+
next-page: /scala3/reference/changed-features/lazy-vals-init
57
---
68

79
Compiler plugins are supported by Dotty (and Scala 3) since 0.9. There are two notable changes

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
layout: doc-page
2+
layout: singlepage-overview
3+
scala3: true
34
title: "Automatic Eta Expansion - More Details"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/eta-expansion-spec.html
55
---
66

77
## Motivation

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Automatic Eta Expansion"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/eta-expansion.html
3+
type: section
4+
num: 66
5+
previous-page: /scala3/reference/changed-features/pattern-matching
6+
next-page: /scala3/reference/changed-features/compiler-plugins
57
---
68

79
The conversion of _methods_ into _functions_ has been improved and happens automatically for methods with one or more parameters.
@@ -36,7 +38,7 @@ rather than `next _`.
3638
The reason for excluding nullary methods from automatic eta expansion
3739
is that Scala implicitly inserts the `()` argument, which would
3840
conflict with eta expansion. Automatic `()` insertion is
39-
[limited](../dropped-features/auto-apply.md) in Scala 3, but the fundamental ambiguity
41+
[limited](../dropped-features/auto-apply.html) in Scala 3, but the fundamental ambiguity
4042
remains.
4143

42-
[More details](eta-expansion-spec.md)
44+
[More details](eta-expansion-spec.html)

docs/docs/reference/changed-features/implicit-conversions-spec.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
layout: doc-page
2+
layout: singlepage-overview
3+
scala3: true
34
title: "Implicit Conversions - More Details"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/implicit-conversions-spec.html
55
---
66

77
## Implementation
@@ -82,7 +82,7 @@ implicit val myConverter: Int => String = _.toString
8282
implicit val myConverter: Conversion[Int, String] = _.toString
8383
```
8484

85-
Note that implicit conversions are also affected by the [changes to implicit resolution](implicit-resolution.md) between Scala 2 and Scala 3.
85+
Note that implicit conversions are also affected by the [changes to implicit resolution](implicit-resolution.html) between Scala 2 and Scala 3.
8686

8787
## Motivation for the changes
8888

@@ -109,9 +109,9 @@ will report a type error, because `Map` isn't an instance of
109109
Implicit values that are used as views should see their type changed to `Conversion`.
110110

111111
For the migration of implicit conversions that are affected by the
112-
changes to implicit resolution, refer to the [Changes in Implicit Resolution](implicit-resolution.md) for more information.
112+
changes to implicit resolution, refer to the [Changes in Implicit Resolution](implicit-resolution.html) for more information.
113113

114114
## Reference
115115

116-
For more information about implicit resolution, see [Changes in Implicit Resolution](implicit-resolution.md).
116+
For more information about implicit resolution, see [Changes in Implicit Resolution](implicit-resolution.html).
117117
Other details are available in [PR #2065](https://github.com/lampepfl/dotty/pull/2065).

docs/docs/reference/changed-features/implicit-conversions.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Implicit Conversions"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/implicit-conversions.html
3+
type: section
4+
num: 60
5+
previous-page: /scala3/reference/changed-features/implicit-resolution
6+
next-page: /scala3/reference/changed-features/overload-resolution
57
---
68

79
An _implicit conversion_, also called _view_, is a conversion that
@@ -61,4 +63,4 @@ implicitly[Ordering[A]] // Ok, will use the implicit conversion from
6163
// `A` to `Int` and the `Ordering` for `Int`.
6264
```
6365

64-
[More details](implicit-conversions-spec.md)
66+
[More details](implicit-conversions-spec.html)

docs/docs/reference/changed-features/implicit-resolution.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---
2-
layout: doc-page
32
title: "Changes in Implicit Resolution"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/implicit-resolution.html
3+
type: section
4+
num: 59
5+
previous-page: /scala3/reference/changed-features/type-inference
6+
next-page: /scala3/reference/changed-features/implicit-conversions
57
---
8+
69
This section describes changes to the implicit resolution that apply both to the new `given`s and to the old-style `implicit`s in Scala 3.
710
Implicit resolution uses a new algorithm which caches implicit results
811
more aggressively for performance. There are also some changes that

docs/docs/reference/changed-features/imports.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Imports"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/imports.html
3+
type: section
4+
num: 56
5+
previous-page: /scala3/reference/changed-features/wildcards
6+
next-page: /scala3/reference/changed-features/type-checking
57
---
68

79
The syntax of wildcard and renaming imports (and exports) has changed.

docs/docs/reference/changed-features/interpolation-escapes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
layout: doc-page
2+
layout: singlepage-overview
3+
scala3: true
34
title: "Escapes in interpolations"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/interpolation-escapes.html
55
---
66

77
In Scala 2 there is no straightforward way to represent a single quote character `"` in a single quoted interpolation. A `\` character can't be used for that because interpolators themselves decide how to handle escaping, so the parser doesn't know whether the `"` should be escaped or used as a terminator.

docs/docs/reference/changed-features/lazy-vals-init.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
3-
title: Lazy Vals initialization
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/lazy-vals-init.html
2+
title: Lazy Vals Initialization
3+
type: section
4+
num: 68
5+
previous-page: /scala3/reference/changed-features/compiler-plugins
6+
next-page: /scala3/reference/changed-features/main-functions
57
---
68

79
Scala 3 implements [Version 6](https://docs.scala-lang.org/sips/improved-lazy-val-initialization.html#version-6---no-synchronization-on-this-and-concurrent-initialization-of-fields)

docs/docs/reference/changed-features/main-functions.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Main Methods"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/main-functions.html
3+
type: section
4+
num: 69
5+
previous-page: /scala3/reference/changed-features/lazy-vals-init
6+
next-page: /scala3/reference/dropped-features
57
---
68

79
Scala 3 offers a new way to define programs that can be invoked from the command line:
@@ -57,7 +59,7 @@ The Scala compiler generates a program from a `@main` method `f` as follows:
5759
- The class has a static method `main` with the usual signature. It takes an `Array[String]`
5860
as argument and returns `Unit`.
5961
- The generated `main` method calls method `f` with arguments converted using
60-
methods in the [`scala.util.CommandLineParser`](https://dotty.epfl.ch/api/scala/util/CommandLineParser$.html) object.
62+
methods in the [`scala.util.CommandLineParser`](https://scala-lang.org/api/3.x/scala/util/CommandLineParser$.html) object.
6163

6264
For instance, the `happyBirthDay` method above would generate additional code equivalent to the following class:
6365

@@ -85,5 +87,5 @@ object happyBirthday extends App:
8587
...
8688
```
8789

88-
The previous functionality of `App`, which relied on the "magic" [`DelayedInit`](../dropped-features/delayed-init.md) trait, is no longer available. [`App`](https://dotty.epfl.ch/api/scala/App.html) still exists in limited form for now, but it does not support command line arguments and will be deprecated in the future. If programs need to cross-build
90+
The previous functionality of `App`, which relied on the "magic" [`DelayedInit`]({% link _scala3-reference/dropped-features/delayed-init.md %}) trait, is no longer available. [`App`](https://scala-lang.org/api/3.x/scala/App.html) still exists in limited form for now, but it does not support command line arguments and will be deprecated in the future. If programs need to cross-build
8991
between Scala 2 and Scala 3, it is recommended to use an explicit `main` method with an `Array[String]` argument instead.

docs/docs/reference/changed-features/match-syntax.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Match Expressions"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/match-syntax.html
3+
type: section
4+
num: 62
5+
previous-page: /scala3/reference/changed-features/overload-resolution
6+
next-page: /scala3/reference/changed-features/vararg-splices
57
---
68

79
The syntactical precedence of match expressions has been changed.
@@ -47,7 +49,7 @@ The syntactical precedence of match expressions has been changed.
4749

4850
The new syntax of match expressions is as follows.
4951

50-
```ebnf
52+
```
5153
InfixExpr ::= ...
5254
| InfixExpr MatchClause
5355
SimpleExpr ::= ...
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Numeric Literals"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/numeric-literals.html
3+
type: section
4+
num: 52
5+
previous-page: /scala3/reference/changed-features
6+
next-page: /scala3/reference/changed-features/structural-types
57
---
68

79
[Document was moved](../experimental/numeric-literals.md)

docs/docs/reference/changed-features/operators.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
---
2-
layout: doc-page
32
title: "Rules for Operators"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/operators.html
3+
type: section
4+
num: 54
5+
previous-page: /scala3/reference/changed-features/structural-types
6+
next-page: /scala3/reference/changed-features/wildcards
57
---
68

79
The rules for infix operators have changed in some parts:
810

911
First, an alphanumeric method can be used as an infix operator only if its definition carries an `infix` modifier. Second, it is recommended (but not enforced) to
10-
augment definitions of symbolic operators with [`@targetName` annotations](../other-new-features/targetName.md). Finally,
12+
augment definitions of symbolic operators with [`@targetName` annotations](../other-new-features/targetName.html). Finally,
1113
a syntax change allows infix operators to be written on the left in a multi-line expression.
1214

1315
## The `infix` Modifier
@@ -97,7 +99,7 @@ or if the `-source future` option is given in Dotty/Scala 3.
9799

98100
## The `@targetName` Annotation
99101

100-
It is recommended that definitions of symbolic operators carry a [`@targetName` annotation](../other-new-features/targetName.md) that provides an encoding of the operator with an alphanumeric name. This has several benefits:
102+
It is recommended that definitions of symbolic operators carry a [`@targetName` annotation](../other-new-features/targetName.html) that provides an encoding of the operator with an alphanumeric name. This has several benefits:
101103

102104
- It helps interoperability between Scala and other languages. One can call
103105
a Scala-defined symbolic operator from another language using its target name,

docs/docs/reference/changed-features/overload-resolution.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Changes in Overload Resolution"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/overload-resolution.html
3+
type: section
4+
num: 61
5+
previous-page: /scala3/reference/changed-features/implicit-conversions
6+
next-page: /scala3/reference/changed-features/match-syntax
57
---
68

79
Overload resolution in Scala 3 improves on Scala 2 in two ways.
@@ -42,7 +44,7 @@ resolution yields several competing alternatives when `n >= 1` parameter lists a
4244
into account, then resolution re-tried using `n + 1` argument lists.
4345

4446
This change is motivated by the new language feature
45-
[extension methods](../contextual/extension-methods.md), where emerges the need to do
47+
[extension methods](../contextual/extension-methods.html), where emerges the need to do
4648
overload resolution based on additional argument blocks.
4749

4850
## Parameter Types of Function Values

docs/docs/reference/changed-features/pattern-bindings.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Pattern Bindings"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/pattern-bindings.html
3+
type: section
4+
num: 64
5+
previous-page: /scala3/reference/changed-features/vararg-splices
6+
next-page: /scala3/reference/changed-features/pattern-matching
57
---
68

79
In Scala 2, pattern bindings in `val` definitions and `for` expressions are

docs/docs/reference/changed-features/pattern-matching.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Option-less pattern matching"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/pattern-matching.html
3+
type: section
4+
num: 65
5+
previous-page: /scala3/reference/changed-features/pattern-bindings
6+
next-page: /scala3/reference/changed-features/eta-expansion
57
---
68

79
The implementation of pattern matching in Scala 3 was greatly simplified compared to Scala 2. From a user perspective, this means that Scala 3 generated patterns are a *lot* easier to debug, as variables all show up in debug modes and positions are correctly preserved.
@@ -241,4 +243,4 @@ Abstract type testing with `ClassTag` is replaced with `TypeTest` or the alias `
241243
- pattern `_: X` for an abstract type requires a `TypeTest` in scope
242244
- pattern `x @ X()` for an unapply that takes an abstract type requires a `TypeTest` in scope
243245

244-
[More details on `TypeTest`](../other-new-features/type-test.md)
246+
[More details on `TypeTest`](../other-new-features/type-test.html)

docs/docs/reference/changed-features/structural-types-spec.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
layout: doc-page
2+
layout: singlepage-overview
3+
scala3: true
34
title: "Programmatic Structural Types - More Details"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/structural-types-spec.html
55
---
66

77
## Syntax
@@ -81,7 +81,7 @@ and `Rs` are structural refinement declarations, and given `v.a` of type `U`, we
8181

8282
Note that `v`'s static type does not necessarily have to conform to `Selectable`, nor does it need to have `selectDynamic` and `applyDynamic` as members. It suffices that there is an implicit
8383
conversion that can turn `v` into a `Selectable`, and the selection methods could also be available as
84-
[extension methods](../contextual/extension-methods.md).
84+
[extension methods](../contextual/extension-methods.html).
8585

8686
## Limitations of Structural Types
8787

docs/docs/reference/changed-features/structural-types.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Programmatic Structural Types"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/structural-types.html
3+
type: section
4+
num: 53
5+
previous-page: /scala3/reference/changed-features/numeric-literals
6+
next-page: /scala3/reference/changed-features/operators
57
---
68

79
## Motivation
@@ -189,4 +191,4 @@ differences.
189191
`java.lang.Class` arguments indicating the method's formal parameter types.
190192
`Dynamic` comes with `updateDynamic`.
191193

192-
[More details](structural-types-spec.md)
194+
[More details](structural-types-spec.html)
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Changes in Type Checking"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/type-checking.html
3+
type: section
4+
num: 57
5+
previous-page: /scala3/reference/changed-features/imports
6+
next-page: /scala3/reference/changed-features/type-inference
57
---
68

79
*** **TO BE FILLED IN** ***

docs/docs/reference/changed-features/type-inference.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Changes in Type Inference"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/type-inference.html
3+
type: section
4+
num: 58
5+
previous-page: /scala3/reference/changed-features/type-checking
6+
next-page: /scala3/reference/changed-features/implicit-resolution
57
---
68

79
For more information, see the two presentations

docs/docs/reference/changed-features/vararg-splices.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: "Vararg Splices"
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/vararg-splices.html
3+
type: section
4+
num: 63
5+
previous-page: /scala3/reference/changed-features/match-syntax
6+
next-page: /scala3/reference/changed-features/pattern-bindings
57
---
68

79
The syntax of vararg splices in patterns and function arguments has changed. The new syntax uses a postfix `*`, analogously to how a vararg parameter is declared.
@@ -24,7 +26,7 @@ The old syntax for splice arguments will be phased out.
2426

2527
## Syntax
2628

27-
```ebnf
29+
```
2830
ArgumentPatterns ::= ‘(’ [Patterns] ‘)’
2931
| ‘(’ [Patterns ‘,’] Pattern2 ‘*’ ‘)’
3032

docs/docs/reference/changed-features/wildcards.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
layout: doc-page
32
title: Wildcard Arguments in Types
4-
movedTo: https://docs.scala-lang.org/scala3/reference/changed-features/wildcards.html
3+
type: section
4+
num: 55
5+
previous-page: /scala3/reference/changed-features/operators
6+
next-page: /scala3/reference/changed-features/imports
57
---
68

79
The syntax of wildcard arguments in types has changed from `_` to `?`. Example:

0 commit comments

Comments
 (0)