Recursive generics
オープン
enhancement
- 主要言語
- Rust
- スター
- 22.3k
- フォーク
- 1.9k
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Not sure if it's a bug or a feature request, since neither way of defining a recursive generic type is in the documentation, afaik.
[A generic's qualification cannot reference itself:
](https://flow.org/try/#0GYVwdgxgLglg9mABMOcA8AVAXIg3gIwEMAnAfhwwF8A+ACgEpdKg
)
```
1: function foo(){}
^ identifier `T`. Could not resolve name
```
[But a type definition can:
](https://flow.org/try/#0C4TwDgpgBAcg9gEwgHgCoD4oF4oG8BQUUARgIYBOAXLIihvgL74BmArgHYDGwAlnO1GZw4yAOroAFO1rV4SMegCUuBkA)
```flow
type Node = {
bar: Node
}
function foo(node: Node){}
```
Judging by the fact the latter is implemented, it shouldn't be hard to add.
コントリビューションガイド
評価
この issue はまだ評価されていません。