Recursive generics
Abierto
enhancement
- Lenguaje dominante
- Rust
- Estrellas
- 22.3k
- Forks
- 1.9k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.