You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: overviews/macros/overview.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ or with `-language:experimental.macros` (providing a compiler switch) on per-com
74
74
75
75
### Generic macros
76
76
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.
78
78
79
79
The following code snippet declares a macro definition `Queryable.map` that references a macro implementation `QImpl.map`:
80
80
@@ -83,7 +83,7 @@ The following code snippet declares a macro definition `Queryable.map` that refe
83
83
}
84
84
85
85
object QImpl {
86
-
def map[T: c.TypeTag, U: c.TypeTag]
86
+
def map[T: c.WeakTypeTag, U: c.WeakTypeTag]
87
87
(c: Context)
88
88
(p: c.Expr[T => U]): c.Expr[Queryable[U]] = ...
89
89
}
@@ -95,7 +95,7 @@ Now consider a value `q` of type `Queryable[String]` and a macro call
95
95
The call is expanded to the following reflective macro invocation
0 commit comments