Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ExtDecl: do not create singleton unions when dealing with case types
Summary: When dealing with case types that are singleton unions, ExtDecl would create an ExtDeclTypeDef with the `type_` field as `(|T)`. This creates problems down the line since this is not a parsable type. `(|T)` results from creating a singleton union `Tunion(T)` then applying the hackrs type printer. That type printer currently prints singleton unions as `(|T)` instead of just `T`. The reason is explained in [this comment](https://www.internalfb.com/diff/D52491369?transaction_fbid=3812697109009854): the code was ported from the ocaml printer `Typing_print.Full`, which is also used for debugging. We could fix the printer, and we do in the previous diff, but it might get broken again later as devs want to debug more stuff. So in addition, we also avoid creating singleton unions altogether before printing. Reviewed By: viratyosin Differential Revision: D67335740 fbshipit-source-id: 8e7673e22e702177eb1ac0a0b724ec9d4215fbf1
- Loading branch information