Improve pretty-printing of types
When doing debug-printing it's really important that the free vars of a type are printed with their uniques. The IfaceTcTyVar thing was a stab in that direction, but it only worked for TcTyVars, not TyVars. This patch does it properly, by keeping track of the free vars of the type when translating Type -> IfaceType, and passing that down through toIfaceTypeX. Then when we find a variable, look in that set, and translate it to IfaceFreeTyVar if so. (I renamed IfaceTcTyVar to IfaceFreeTyVar.) Fiddly but not difficult. Reviewers: austin, goldfire, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3201
Showing
- compiler/backpack/RnModIface.hs 2 additions, 2 deletionscompiler/backpack/RnModIface.hs
- compiler/iface/IfaceSyn.hs 1 addition, 1 deletioncompiler/iface/IfaceSyn.hs
- compiler/iface/IfaceType.hs 19 additions, 19 deletionscompiler/iface/IfaceType.hs
- compiler/iface/TcIface.hs 1 addition, 1 deletioncompiler/iface/TcIface.hs
- compiler/iface/ToIface.hs 84 additions, 63 deletionscompiler/iface/ToIface.hs
- compiler/iface/ToIface.hs-boot 2 additions, 0 deletionscompiler/iface/ToIface.hs-boot
- compiler/typecheck/TcRnTypes.hs 3 additions, 2 deletionscompiler/typecheck/TcRnTypes.hs
- compiler/types/TyCoRep.hs 22 additions, 15 deletionscompiler/types/TyCoRep.hs
- compiler/types/Type.hs 1 addition, 1 deletioncompiler/types/Type.hs
- compiler/types/Type.hs-boot 1 addition, 1 deletioncompiler/types/Type.hs-boot
- testsuite/tests/deriving/should_fail/T7148.stderr 4 additions, 4 deletionstestsuite/tests/deriving/should_fail/T7148.stderr
- testsuite/tests/th/T8761.stderr 28 additions, 29 deletionstestsuite/tests/th/T8761.stderr
- testsuite/tests/typecheck/should_fail/T12785b.stderr 7 additions, 8 deletionstestsuite/tests/typecheck/should_fail/T12785b.stderr
Loading
Please register or sign in to comment