Skip to content

No test/assertion for kcLHsQTyVars_Cusk solveEqualities

In kcLHsQTyVars_Cusk, there are these lines:

    do { (scoped_kvs, (tc_tvs, res_kind))
           <- pushTcLevelM_                               $
              solveEqualities                             $
              bindImplicitTKBndrs_Q_Skol kv_ns            $
              bindExplicitTKBndrs_Q_Skol ctxt_kind hs_tvs $
              thing_inside

I'm using them as a model for the TLKS implementation, and right now I'm trying to understand what solveEqualities is doing here. So here's what I did:

  1. I commented out the solveEqualities $ line and ran the test suite. It did not cause any failures.
  2. I did some git history digging and found out that this call was added in 55577a91 to fix #11648 (closed). From reading the discussion I figured that I need a -DDEBUG compiler to see the error, as it's an assertion failure.
  3. I've built GHC with the devel2 flavour (it turns on -DDEBUG) and ran the tests mentioned in #11648 (closed), there were no errors still. (Just to make sure that I have assertions enabled, I added MASSERT(False) and it failed)

Now I'm puzzled. What purpose does solveEqualities serve here? We need a test case that would fail without it!

Edited by Vladislav Zavialov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information