Use dischargeFunEq consistently
Trac #15122 turned out to be interesting. * Were calling dischargeFmv in three places. * In all three cases we dealt with the Given case separately. * In two of the three cases the Given code was right, (albeit duplicated). * In the third case (in TcCanonical.canCFunEqCan), we had ; case flav of Given -> return () -- nothing more to do. which was utterly wrong. The solution is easy: move the Given-case handling into dischargeFmv (now reenamed dischargeFunEq), and delete it from the call sites. Result: less code, easier to understand (dischargeFunEq handles all three cases, not just two out of three), and Trac #15122 is fixed.
Showing
- compiler/typecheck/TcCanonical.hs 14 additions, 22 deletionscompiler/typecheck/TcCanonical.hs
- compiler/typecheck/TcInteract.hs 11 additions, 38 deletionscompiler/typecheck/TcInteract.hs
- compiler/typecheck/TcSMonad.hs 22 additions, 12 deletionscompiler/typecheck/TcSMonad.hs
- testsuite/tests/indexed-types/should_compile/T15122.hs 16 additions, 0 deletionstestsuite/tests/indexed-types/should_compile/T15122.hs
- testsuite/tests/indexed-types/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/indexed-types/should_compile/all.T
Loading
Please register or sign in to comment