glideapps/quicktype

Detect and properly handle recursive types

Open

#273 ouverte le 14 nov. 2017

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)TypeScript (968 forks)batch import
Elmbuggood first issue

Métriques du dépôt

Stars
 (10 867 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Recursive types can result even from JSON input (via merging of similar types - see the recursive.json sample), so every backend either needs to be able to handle them, or signal that it can't. Some languages, like Swift, require an option to handle them, so we'd either have to turn that option on when recursive types are involved, or only allow merging in case the option is on. It would be even better if we had an analysis that could detect not only whether there are recursive types, but which types are involved in the recursion, which would allow us to generate class types only for them in Swift, for example, or emit forward declarations in C++.

Guide contributeur