File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -169,15 +169,15 @@ usage. But the code can be made phase correct by adding a binding
169
169
of a ` Type[T] ` tag:
170
170
171
171
def reflect[T, U](f: Expr[T] => Expr[U])(implicit t: Type[T]): Expr[T => U] =
172
- ’{ (x: ~t) => ~f(’(x))
172
+ ’{ (x: ~t) => ~f(’(x)) }
173
173
174
174
In this version of ` reflect ` , the type of ` x ` is now the result of
175
175
splicing the ` Type ` value ` t ` . This operation _ is_ splice correct -- there
176
176
is one quote and one splice between the use of ` t ` and its definition.
177
177
178
178
To avoid clutter, the Scala implementation tries to convert any phase-incorrect
179
179
reference to a type ` T ` to a type-splice, by rewriting ` T ` to ` ~implicitly[Type[T]] ` .
180
- For instance, the user-level definition of ` reflect `
180
+ For instance, the user-level definition of ` reflect ` :
181
181
182
182
def reflect[T: Type, U](f: Expr[T] => Expr[U]) Expr[T => U] =
183
183
’{ (x: T) => ~f(’(x)) }
You can’t perform that action at this time.
0 commit comments