@@ -124,32 +124,32 @@ object Annotations {
124
124
}
125
125
126
126
/** Create an annotation where the tree is computed lazily. */
127
- def deferred (sym : Symbol , treeFn : Context => Tree )(implicit ctx : Context ): Annotation =
127
+ def deferred (sym : Symbol )( treeFn : given Context => Tree )(implicit ctx : Context ): Annotation =
128
128
new LazyAnnotation {
129
129
override def symbol (implicit ctx : Context ): Symbol = sym
130
- def complete (implicit ctx : Context ) = treeFn( ctx)
130
+ def complete (implicit ctx : Context ) = treeFn given ctx
131
131
}
132
132
133
133
/** Create an annotation where the symbol and the tree are computed lazily. */
134
- def deferredSymAndTree (symf : Context => Symbol , treeFn : Context => Tree )(implicit ctx : Context ): Annotation =
134
+ def deferredSymAndTree (symf : given Context => Symbol )( treeFn : given Context => Tree )(implicit ctx : Context ): Annotation =
135
135
new LazyAnnotation {
136
136
private [this ] var mySym : Symbol = _
137
137
138
138
override def symbol (implicit ctx : Context ): Symbol = {
139
139
if (mySym == null || mySym.defRunId != ctx.runId) {
140
- mySym = symf( ctx)
140
+ mySym = symf given ctx
141
141
assert(mySym != null )
142
142
}
143
143
mySym
144
144
}
145
- def complete (implicit ctx : Context ) = treeFn( ctx)
145
+ def complete (implicit ctx : Context ) = treeFn given ctx
146
146
}
147
147
148
148
def deferred (atp : Type , args : List [Tree ])(implicit ctx : Context ): Annotation =
149
- deferred(atp.classSymbol, implicit ctx => New (atp, args))
149
+ deferred(atp.classSymbol)( New (atp, args))
150
150
151
151
def deferredResolve (atp : Type , args : List [Tree ])(implicit ctx : Context ): Annotation =
152
- deferred(atp.classSymbol, implicit ctx => resolveConstructor(atp, args))
152
+ deferred(atp.classSymbol)( resolveConstructor(atp, args))
153
153
154
154
def makeAlias (sym : TermSymbol )(implicit ctx : Context ): Annotation =
155
155
apply(defn.AliasAnnot , List (
@@ -165,7 +165,7 @@ object Annotations {
165
165
New (defn.ChildAnnotType .appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil )
166
166
.withSpan(span)
167
167
}
168
- deferred(defn.ChildAnnot , implicit ctx => makeChildLater(ctx))
168
+ deferred(defn.ChildAnnot )( makeChildLater(ctx))
169
169
}
170
170
171
171
/** A regular, non-deferred Child annotation */
0 commit comments