swift icon indicating copy to clipboard operation
swift copied to clipboard

[AST] More JSON AST dump improvements.

Open allevato opened this issue 9 months ago • 2 comments

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.

allevato avatar Apr 03 '25 16:04 allevato

@slavapestov Thanks for all the pointers for these improvements. Would you mind reviewing this change please?

allevato avatar Apr 03 '25 16:04 allevato

@slavapestov Any other changes you'd like to see here?

allevato avatar Apr 08 '25 13:04 allevato

@swift-ci please test

allevato avatar Apr 11 '25 15:04 allevato

@swift-ci please smoke test

allevato avatar Apr 22 '25 12:04 allevato

@swift-ci please smoke test

allevato avatar Apr 22 '25 20:04 allevato

@swift-ci please smoke test Linux platform

allevato avatar Apr 23 '25 16:04 allevato