Handle ConcreteTvs in inferResultToType
This patch fixes two issues. 1. inferResultToType was discarding the ir_frr information, which meant some metavariables ended up being MetaTvs instead of ConcreteTvs. This function now creates new ConcreteTvs as necessary, instead of always creating MetaTvs. 2. startSolvingByUnification can make some type variables concrete. However, it didn't return an updated type, so callers of this function, if they don't zonk, might miss this and accidentally perform a double update of a metavariable. We now return the updated type from this function, which avoids this issue. Fixes #23154 (cherry picked from commit 9ab9b30e)
Showing
- compiler/GHC/Tc/Gen/Head.hs 1 addition, 1 deletioncompiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Solver/Canonical.hs 1 addition, 1 deletioncompiler/GHC/Tc/Solver/Canonical.hs
- compiler/GHC/Tc/Solver/Interact.hs 1 addition, 1 deletioncompiler/GHC/Tc/Solver/Interact.hs
- compiler/GHC/Tc/Solver/Monad.hs 22 additions, 22 deletionscompiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs 52 additions, 9 deletionscompiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/Unify.hs 22 additions, 23 deletionscompiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Utils/Zonk.hs 1 addition, 1 deletioncompiler/GHC/Tc/Utils/Zonk.hs
- testsuite/tests/rep-poly/RepPolyPatBind.stderr 33 additions, 0 deletionstestsuite/tests/rep-poly/RepPolyPatBind.stderr
- testsuite/tests/rep-poly/T23154.hs 7 additions, 0 deletionstestsuite/tests/rep-poly/T23154.hs
- testsuite/tests/rep-poly/T23154.stderr 15 additions, 0 deletionstestsuite/tests/rep-poly/T23154.stderr
- testsuite/tests/rep-poly/all.T 1 addition, 0 deletionstestsuite/tests/rep-poly/all.T
- testsuite/tests/typecheck/should_fail/VtaFail.stderr 2 additions, 2 deletionstestsuite/tests/typecheck/should_fail/VtaFail.stderr
Loading
Please register or sign in to comment