@@ -41,7 +41,7 @@ For a class/trait/object/enum `DerivingType[T_1, ..., T_N] derives TC`, a derive
41
41
42
42
The general "shape" of the derived instance is as follows:
43
43
``` scala
44
- given [...]: TC [ ... DerivingType [...] ... ] = TC .derived
44
+ given [...]( using ...) : TC [ ... DerivingType [...] ... ] = TC .derived
45
45
```
46
46
` TC.derived ` should be an expression that conforms to the expected type on the left, potentially elaborated using term and/or type inference.
47
47
@@ -64,6 +64,9 @@ given [T_1: TC, ..., T_N: TC]: TC[DerivingType[T_1, ..., T_N]] = TC.derived
64
64
65
65
This is the most common case, and is the one that was highlighted in the introduction.
66
66
67
+ ** Note:** The ` [T_i: TC, ...] ` introduces a ` (using TC[T_i], ...) ` , more information in [ Context Bounds] ( ./context-bounds.md ) .
68
+ This allows the ` derived ` member to access these evidences.
69
+
67
70
** Note:** If ` N == 0 ` the above means:
68
71
``` scala
69
72
given TC [DerivingType ] = TC .derived
@@ -116,6 +119,7 @@ given [T_1, ... T_(N-K)]: TC[[A_1, ..., A_K] =>> DerivingType[T_1, ... T_(N-K),
116
119
We have therefore: ` DerivingType[T_1, ..., T_N] derives CanEqual ` .
117
120
118
121
Let ` U_1 ` , ..., ` U_M ` be the parameters of ` DerivingType ` of kind ` * ` .
122
+ (These are a subset of the ` T_i ` s)
119
123
120
124
The generated instance is then:
121
125
``` scala
0 commit comments