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/implicit-resolution.md
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -122,8 +122,7 @@ most (but not all) divergence errors in Scala 2 would terminate the implicit sea
122
122
defbuzz(y: A) =???
123
123
buzz(1) // error: ambiguous
124
124
```
125
-
**7.**The rule for picking a _most specific_ alternative among a set of overloaded or implicit alternatives is refined to take context parameters into account. Allelse being equal, an alternative that takes some context parameters is taken to be less specific than an alternative that takes none. If both alternatives take context parameters, we try to choose between them asif they were methods with regular parameters. The following paragraph in the [SLS §
126
-
6.26.3](https://scala-lang.org/files/archive/spec/2.13/06-expressions.html#overloading-resolution) is affected by thischange:
125
+
**7.**The rule for picking a _most specific_ alternative among a set of overloaded or implicit alternatives is refined to take context parameters into account. Allelse being equal, an alternative that takes some context parameters is taken to be less specific than an alternative that takes none. If both alternatives take context parameters, we try to choose between them asif they were methods with regular parameters. The following paragraph in the [SLS §6.26.3](https://scala-lang.org/files/archive/spec/2.13/06-expressions.html#overloading-resolution) is affected by thischange:
Copy file name to clipboardExpand all lines: docs/docs/reference/changed-features/overload-resolution.md
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,7 @@ g(2)(3)(4) // ok
33
33
g(2)(3)("") // ok
34
34
```
35
35
36
-
To make this work, the rules for overloading resolution in [SLS §
37
-
6.26.3](https://www.scala-lang.org/files/archive/spec/2.13/06-expressions.html#overloading-resolution) are augmented
36
+
To make this work, the rules for overloading resolution in [SLS §6.26.3](https://www.scala-lang.org/files/archive/spec/2.13/06-expressions.html#overloading-resolution) are augmented
38
37
as follows:
39
38
40
39
> In a situation where a function is applied to more than one argument list, if overloading
To make this work, the rules for overloading resolution in [SLS §
62
-
6.26.3](https://www.scala-lang.org/files/archive/spec/2.13/06-expressions.html#overloading-resolution) are modified
60
+
To make this work, the rules for overloading resolution in [SLS §6.26.3](https://www.scala-lang.org/files/archive/spec/2.13/06-expressions.html#overloading-resolution) are modified
Copy file name to clipboardExpand all lines: docs/docs/reference/contextual/motivation.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ The following pages introduce a redesign of contextual abstractions in Scala. Th
49
49
50
50
1. [GivenInstances](./givens.md) are a new way to define basic terms that can be synthesized. They replace implicit definitions. The core principle of the proposal is that, rather than mixing the `implicit` modifier with a large number of features, we have a single way to define terms that can be synthesized for types.
51
51
52
-
2. [`using`Clauses](./using-clauses.md) are a new syntax forimplicit _parameters_ and their _arguments_. It unambiguously aligns parameters and arguments, solving a number of language warts. It also allows us to have several `using` clauses in a definition.
52
+
2. [UsingClauses](./using-clauses.md) are a new syntax forimplicit _parameters_ and their _arguments_. It unambiguously aligns parameters and arguments, solving a number of language warts. It also allows us to have several `using` clauses in a definition.
53
53
54
54
3. ["Given"Imports](./given-imports.md) are a newclassofimportselectorsthatspecificallyimport
constant expressions in the sense defined by the [SLS §6.24](https://www.scala-lang.org/files/archive/spec/2.13/06-expressions.html#constant-expressions),
231
230
including _platform-specific_ extensions such as constant folding of pure
Many of these singleton operation types are meant to be used infix (as in [SLS §3.2.10](https://www.scala-lang.org/files/archive/spec/2.13/03-types.html#infix-types)).
506
504
507
505
Since type aliases have the same precedence rules as their term-level
508
506
equivalents, the operations compose with the expected precedence rules:
Copy file name to clipboardExpand all lines: docs/docs/reference/metaprogramming/macros.md
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -78,8 +78,8 @@ ${'[T]} = T
78
78
The type signatures of quotes and splices can be described using
79
79
two fundamental types:
80
80
81
-
-`Expr[T]`: abstract syntax trees representing expressions of type `T`
82
-
-`Type[T]`: type structures representing type `T`.
81
+
-`Expr[T]`: abstract syntax trees representing expressions of type `T`
82
+
-`Type[T]`: type structures representing type `T`.
83
83
84
84
Quoting takes expressions of type `T` to expressions of type `Expr[T]`
85
85
and it takes types `T` to expressions of type `Type[T]`. Splicing
@@ -103,7 +103,7 @@ operations that will be discussed later on.
103
103
A fundamental *phase consistency principle* (PCP) regulates accesses
104
104
to free variables in quoted and spliced code:
105
105
106
-
-_For any free variable reference `x`, the number of quoted scopes and the number of spliced scopes between the reference to `x` and the definition of `x` must be equal_.
106
+
-_For any free variable reference `x`, the number of quoted scopes and the number of spliced scopes between the reference to `x` and the definition of `x` must be equal_.
107
107
108
108
Here, `this`-references count as free variables. On the other
109
109
hand, we assume that all imports are fully expanded and that `_root_` is
@@ -129,8 +129,8 @@ situations described above.
129
129
130
130
In what concerns the range of features it covers, this form of macros introduces
131
131
a principled metaprogramming framework that is quite close to the MetaML family of
132
-
languages. One difference is that MetaML does not have an equivalent of the PCP
133
-
-quoted code in MetaML _can_ access variables in its immediately enclosing
132
+
languages. One difference is that MetaML does not have an equivalent of the PCP -
133
+
quoted code in MetaML _can_ access variables in its immediately enclosing
134
134
environment, with some restrictions and caveats since such accesses involve
135
135
serialization. However, this does not constitute a fundamental gain in
136
136
expressiveness.
@@ -632,10 +632,9 @@ It is possible to deconstruct or extract values out of `Expr` using pattern matc
632
632
633
633
`scala.quoted` contains objects that can help extracting values from `Expr`.
634
634
635
-
*`scala.quoted.Expr`/`scala.quoted.Exprs`: matches an expression of a value (or list of values) and returns the value (or list of values).
636
-
*`scala.quoted.Const`/`scala.quoted.Consts`: Same as `Expr`/`Exprs` but only works on primitive values.
637
-
*`scala.quoted.Varargs`: matches an explicit sequence of expressions and returns them. These sequences are useful to get individual `Expr[T]` out of a varargs expression of type `Expr[Seq[T]]`.
638
-
635
+
-`scala.quoted.Expr`/`scala.quoted.Exprs`: matches an expression of a value (or list of values) and returns the value (or list of values).
636
+
-`scala.quoted.Const`/`scala.quoted.Consts`: Same as `Expr`/`Exprs` but only works on primitive values.
637
+
-`scala.quoted.Varargs`: matches an explicit sequence of expressions and returns them. These sequences are useful to get individual `Expr[T]` out of a varargs expression of type `Expr[Seq[T]]`.
639
638
640
639
These could be used in the following way to optimize any call to `sum` that has statically known values.
0 commit comments