Add info about typeclass evidence to .hie files
See `testsuite/tests/hiefile/should_run/HieQueries.hs` and `testsuite/tests/hiefile/should_run/HieQueries.stdout` for an example of this We add two new fields, `EvidenceVarBind` and `EvidenceVarUse` to the `ContextInfo` associated with an Identifier. These are associated with the appropriate identifiers for the evidence variables collected when we come across `HsWrappers`, `TcEvBinds` and `IPBinds` while traversing the AST. Instance dictionary and superclass selector dictionaries from `tcg_insts` and classes defined in `tcg_tcs` are also recorded in the AST as originating from their definition span This allows us to save a complete picture of the evidence constructed by the constraint solver, and will let us report this to the user, enabling features like going to the instance definition from the invocation of a class method(or any other method taking a constraint) and finding all usages of a particular instance. Additionally, - Mark NodeInfo with an origin so we can differentiate between bindings origininating in the source vs those in ghc - Along with typeclass evidence info, also include information on Implicit Parameters - Add a few utility functions to HieUtils in order to query the new info Updates haddock submodule
parent
b8c014ce
Pipeline #19828 passed with warnings
Stage: lint
Stage: quick-build
Stage: build
Stage: full-build
Stage: cleanup
Stage: packaging
Stage: testing
Stage: deploy
Showing
- compiler/GHC/Iface/Ext/Ast.hs 319 additions, 122 deletionscompiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Ext/Binary.hs 0 additions, 46 deletionscompiler/GHC/Iface/Ext/Binary.hs
- compiler/GHC/Iface/Ext/Debug.hs 33 additions, 17 deletionscompiler/GHC/Iface/Ext/Debug.hs
- compiler/GHC/Iface/Ext/Types.hs 168 additions, 8 deletionscompiler/GHC/Iface/Ext/Types.hs
- compiler/GHC/Iface/Ext/Utils.hs 143 additions, 25 deletionscompiler/GHC/Iface/Ext/Utils.hs
- testsuite/tests/hiefile/should_compile/Scopes.hs 24 additions, 1 deletiontestsuite/tests/hiefile/should_compile/Scopes.hs
- testsuite/tests/hiefile/should_run/HieQueries.hs 82 additions, 0 deletionstestsuite/tests/hiefile/should_run/HieQueries.hs
- testsuite/tests/hiefile/should_run/HieQueries.stdout 98 additions, 0 deletionstestsuite/tests/hiefile/should_run/HieQueries.stdout
- testsuite/tests/hiefile/should_run/PatTypes.hs 4 additions, 11 deletionstestsuite/tests/hiefile/should_run/PatTypes.hs
- testsuite/tests/hiefile/should_run/all.T 1 addition, 0 deletionstestsuite/tests/hiefile/should_run/all.T
- utils/haddock 1 addition, 1 deletionutils/haddock
Loading
-
mentioned in merge request !1286 (closed)
-
mentioned in issue #15613
Please register or sign in to comment