Avatar
omochimetaru 3/8/2019 3:22 AM
When the first seed of Swift came out many years ago, there were technical reasons for the "self or associated type" constraint on protocol existentials: At that time, protocol witness tables did not carry associated type information, so it was impossible to re-open the dynam...
3:23 AM
Generalized Existential?スレはここか。
3:28 AM
Selfかassoctypeのあるprotocolをexistentialに使えない理由として、 昔は実装上witness tableに真の型が入ってなくてre-openできなかったから無理だったけど、 最近Recursive constrained protocolの対応をしたときに、それも実行時に運ぶようになったから、 原理上可能になっている その後のくだりがよくわからなくって、 Selfとassoctypeに関してcontravariantなメソッドをextentionで追加できるという型システム上の問題はすでに存在している とかなんとか
3:31 AM
associated typeについてconstraintを設定できないから完全なgeneralized existentialの話ではないらしい