You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_docs/reference/changed-features/imports.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,13 +38,13 @@ import scala.annotation as ann
38
38
importjava as j
39
39
```
40
40
41
-
###Migration
41
+
## Migration
42
42
43
43
To support cross-building, Scala 3.0 supports the old import syntax with `_` for wildcards and `=>` for renamings in addition to the new one. The old syntax
44
44
will be dropped in a future versions. Automatic rewritings from old to new syntax
45
45
are offered under settings `-source 3.1-migration -rewrite`.
The migration to the new scheme is complicated, in particular since the [kind projector](https://github.com/typelevel/kind-projector)
27
27
compiler plugin still uses the reverse convention, with `?` meaning parameter placeholder instead of wildcard. Fortunately, kind projector has added `*` as an alternative syntax for `?`.
Copy file name to clipboardExpand all lines: docs/_docs/reference/contextual/context-functions.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ For example, continuing with the previous definitions,
48
48
g((ctx: ExecutionContext) ?=> f(3)(using ctx)) // is left as it is
49
49
```
50
50
51
-
###Example: Builder Pattern
51
+
## Example: Builder Pattern
52
52
53
53
Context function types have considerable expressive power. For
54
54
instance, here is how they can support the "builder pattern", where
@@ -112,7 +112,7 @@ With that setup, the table construction code above compiles and expands to:
112
112
}(using $t)
113
113
}
114
114
```
115
-
###Example: Postconditions
115
+
## Example: Postconditions
116
116
117
117
As a larger example, here is a way to define constructs for checking arbitrary postconditions using an extension method `ensuring` so that the checked result can be referred to simply by `result`. The example combines opaque type aliases, context function types, and extension methods to provide a zero-overhead abstraction.
118
118
@@ -146,7 +146,7 @@ val s =
146
146
assert(result ==6)
147
147
result
148
148
```
149
-
###Reference
149
+
## Reference
150
150
151
151
For more information, see the [blog article](https://www.scala-lang.org/blog/2016/12/07/implicit-function-types.html),
152
152
(which uses a different syntax that has been superseded).
0 commit comments