swift
swift copied to clipboard
[AST] More JSON AST dump improvements.
These improvements came about through great back-and-forth in this forum thread. They are summarized as follows:
- Instead of using a custom-rolled type transformer, call
mapTypeOutOfContext()to replace any primary archetypes with type parameters when computing a type USR. - If the type still contains local archetypes, replace them with an equivalent existential.
- When dumping type inheritance, print the derived semantic information (all protocol conformances, raw type for enums, superclass/inherited protocols, etc.).
- Dump additional information about protocol conformances (safety, preconcurrency, isolation, etc.). (I also decided to do this in the default dump, since it seems useful there.)
- Add a source-file-level mapping of opaque type USRs to the USR of the equivalent existential type.
@slavapestov Thanks for all the pointers for these improvements. Would you mind reviewing this change please?
@slavapestov Any other changes you'd like to see here?
@swift-ci please test
@swift-ci please smoke test
@swift-ci please smoke test
@swift-ci please smoke test Linux platform