8000 Merge pull request #184 from xeno-by/master · scala/docs.scala-lang@169cbe0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 169cbe0

Browse files
committed
Merge pull request #184 from xeno-by/master
TypeTag => WeakTypeTag in the macro guide
2 parents 25b7e7a + 43798d6 commit 169cbe0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

overviews/macros/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ or with `-language:experimental.macros` (providing a compiler switch) on per-com
7474

7575
### Generic macros
7676

77-
Macro definitions and macro implementations may both be generic. If a macro implementation has type parameters, actual type arguments must be given explicitly in the macro definition’s body. Type parameters in an implementation may come with `TypeTag` context bounds. In that case the corresponding type tags describing the actual type arguments instantiated at the application site will be passed along when the macro is expanded.
77+
Macro definitions and macro implementations may both be generic. If a macro implementation has type parameters, actual type arguments must be given explicitly in the macro definition’s body. Type parameters in an implementation may come with `WeakTypeTag` context bounds. In that case the corresponding type tags describing the actual type arguments instantiated at the application site will be passed along when the macro is expanded.
7878

7979
The following code snippet declares a macro definition `Queryable.map` that references a macro implementation `QImpl.map`:
8080

@@ -83,7 +83,7 @@ The following code snippet declares a macro definition `Queryable.map` that refe
8383
}
8484

8585
object QImpl {
86-
def map[T: c.TypeTag, U: c.TypeTag]
86+
def map[T: c.WeakTypeTag, U: c.WeakTypeTag]
8787
(c: Context)
8888
(p: c.Expr[T => U]): c.Expr[Queryable[U]] = ...
8989
}
@@ -95,7 +95,7 @@ Now consider a value `q` of type `Queryable[String]` and a macro call
9595
The call is expanded to the following reflective macro invocation
9696

9797
QImpl.map(c)(<[ s => s.length ]>)
98-
(implicitly[TypeTag[String]], implicitly[TypeTag[Int]])
98+
(implicitly[WeakTypeTag[String]], implicitly[WeakTypeTag[Int]])
9999

100100
## A complete example
101101

0 commit comments

Comments
 (0)
0