@@ -34,8 +34,8 @@ a given for the type `Ord[Int]` whereas `listOrd[T]` defines givens
34
34
for ` Ord[List[T]] ` for all types ` T ` that come with a given instance for ` Ord[T] `
35
35
themselves. The ` using ` clause in ` listOrd ` defines a condition: There must be a
36
36
given of type ` Ord[T] ` for a given of type ` List[Ord[T]] ` to exist.
37
- Such conditions are expanded by the compiler to context
38
- parameters, which are explained in the [ next section ] ( ./using-clauses.html ) .
37
+ Such conditions are expanded by the compiler to [ context
38
+ parameters] ( ./using-clauses.html ) .
39
39
40
40
## Anonymous Givens
41
41
@@ -57,14 +57,16 @@ given global as ExecutionContext = new ForkJoinPool()
57
57
This creates a given ` global ` of type ` ExecutionContext ` that resolves to the right
58
58
hand side ` new ForkJoinPool() ` .
59
59
The first time ` global ` is accessed, a new ` ForkJoinPool ` is created, which is then
60
- returned for this and all subsequent accesses to ` global ` .
60
+ returned for this and all subsequent accesses to ` global ` . This operation is thread-safe.
61
61
62
- Alias givens can be anonymous, e.g.
62
+ Alias givens can be anonymous as well , e.g.
63
63
``` scala
64
64
given Position = enclosingTree.position
65
65
given (using outer : Context ) as Context = outer.withOwner(currentOwner)
66
66
```
67
- An alias given can have type parameters and implicit parameters just like any other given,
67
+ <!-- TODO IMO the above example is very bad as the outer Context will always have precedence over the anonymous one. No? -->
68
+
69
+ An alias given can have type parameters and context parameters just like any other given,
68
70
but it can only implement a single type.
69
71
70
72
## Given Whitebox Macro Instances
0 commit comments