仮型引数に実型引数を「渡す」と何が起こるか
概要
ジェネリッククラス/インターフェースに実型引数を与えた際のメンバの型の仕様
http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.5.2
の勉強。よく分かっていない
本文
仮型引数に実型引数を「渡す」ことはinvocationでした。→ 実型引数を仮型引数に「渡す」
ではinvocationをすると何が起こるのでしょうか。
1. Cを仮型引数A1,...,Anを伴うクラスまたはインターフェース宣言として、C
Let C be a generic class or interface declaration with type parameters A1,...,An, and let C
be an invocation of C, where, for 1 ≤ i ≤ n, Ti are types (rather than wildcards). Then: Let m be a member or constructor declaration (§8.2, §8.8.6) in C, whose type as declared is T.
The type of m in C
http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.5.2is T[A1:=T1,...,An:=Tn].
以下適当な訳
2. mをCのスーパークラスDで定義されたメンバとして、mの型はC
3. C
4. C
ふむ。
4. だけ理由がよくわからない。また調べる。