@@ -34,8 +34,8 @@ a given for the type `Ord[Int]` whereas `listOrd[T]` defines givens
3434for ` Ord[List[T]] ` for all types ` T ` that come with a given instance for ` Ord[T] `
3535themselves. The ` using ` clause in ` listOrd ` defines a condition: There must be a
3636given 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 ) .
3939
4040## Anonymous Givens
4141
@@ -57,14 +57,16 @@ given global as ExecutionContext = new ForkJoinPool()
5757This creates a given ` global ` of type ` ExecutionContext ` that resolves to the right
5858hand side ` new ForkJoinPool() ` .
5959The 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.
6161
62- Alias givens can be anonymous, e.g.
62+ Alias givens can be anonymous as well , e.g.
6363``` scala
6464given Position = enclosingTree.position
6565given (using outer : Context ) as Context = outer.withOwner(currentOwner)
6666```
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,
6870but it can only implement a single type.
6971
7072## Given Whitebox Macro Instances
0 commit comments