glideapps/quicktype

Detect and properly handle recursive types

Open

#273 创建于 2017年11月14日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)TypeScript (10,867 star) (968 fork)batch import
Elmbuggood first issue

描述

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++.

贡献者指南