Skip to content

Commit 2c05944

Browse files
committed
Macro translation. Track scala/docs.scala-lang@43798d6
"TypeTag => WeakTypeTag in the macro guide"
1 parent c8f1a52 commit 2c05944

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ja/overviews/macros/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ title: def マクロ
6464

6565
### 多相的なマクロ
6666

67-
マクロ定義とマクロ実装の両方ともジェネリックにすることができる。もしマクロ実装に型パラメータがあれば、マクロ定義の本文において実際の型引数が明示的に渡される必要がある。実装内での型パラメータは context bounds の `TypeTag` と共に宣言することができる。その場合、適用サイトでの実際の型引数を記述した型タグがマクロの展開時に一緒に渡される。
67+
マクロ定義とマクロ実装の両方ともジェネリックにすることができる。もしマクロ実装に型パラメータがあれば、マクロ定義の本文において実際の型引数が明示的に渡される必要がある。実装内での型パラメータは context bounds の `WeakTypeTag` と共に宣言することができる。その場合、適用サイトでの実際の型引数を記述した型タグがマクロの展開時に一緒に渡される。
6868

6969
以下のコードはマクロ実装 `QImpl.map` を参照するマクロ定義 `Queryable.map` を宣言する:
7070

@@ -73,7 +73,7 @@ title: def マクロ
7373
}
7474

7575
object QImpl {
76-
def map[T: c.TypeTag, U: c.TypeTag]
76+
def map[T: c.WeakTypeTag, U: c.WeakTypeTag]
7777
(c: Context)
7878
(p: c.Expr[T => U]): c.Expr[Queryable[U]] = ...
7979
}
@@ -85,7 +85,7 @@ title: def マクロ
8585
を考える。この呼び出しは以下の reflective なマクロ呼び出しに展開される。
8686

8787
QImpl.map(c)(<[ s => s.length ]>)
88-
(implicitly[TypeTag[String]], implicitly[TypeTag[Int]])
88+
(implicitly[WeakTypeTag[String]], implicitly[WeakTypeTag[Int]])
8989

9090
## 完全な具体例
9191

0 commit comments

Comments
 (0)