[Git][ghc/ghc][wip/T17775] 2 commits: Wibbles

Simon Peyton Jones gitlab at gitlab.haskell.org
Fri Apr 24 14:44:42 UTC 2020



Simon Peyton Jones pushed to branch wip/T17775 at Glasgow Haskell Compiler / GHC


Commits:
9c1f41ce by Simon Peyton Jones at 2020-04-24T15:42:26+01:00
Wibbles

- - - - -
8095fb16 by Simon Peyton Jones at 2020-04-24T15:43:26+01:00
Get the right version of Haddock

(Thanks Ryan.)

- - - - -


2 changed files:

- compiler/GHC/Tc/Solver.hs
- utils/haddock


Changes:

=====================================
compiler/GHC/Tc/Solver.hs
=====================================
@@ -160,17 +160,19 @@ simplifyTop wanteds
 -- should generally bump the TcLevel to make sure that this run of the solver
 -- doesn't affect anything lying around.
 solveLocalEqualities :: String -> TcM a -> TcM a
+-- Note [Failure in local type signatures]
 solveLocalEqualities callsite thing_inside
   = do { (wanted, res) <- solveLocalEqualitiesX callsite thing_inside
        ; emitFlatConstraints wanted
        ; return res }
 
 emitFlatConstraints :: WantedConstraints -> TcM ()
+-- See Note [Failure in local type signatures]
 emitFlatConstraints wanted
   = do { wanted <- TcM.zonkWC wanted
        ; case floatKindEqualities wanted of
            Nothing -> do { traceTc "emitFlatConstraints: failing" (ppr wanted)
-                         ; emitConstraints wanted
+                         ; emitConstraints wanted -- So they get reported!
                          ; failM }
            Just simple_wanteds -> do { _ <- promoteTyVarSet $
                                             tyCoVarsOfCts simple_wanteds
@@ -201,10 +203,11 @@ floatKindEqualities wc = float_wc emptyVarSet wc
       = Nothing   -- A short cut /plus/ we must keep track of IC_BadTelescope
       | otherwise
       = do { cts <- float_wc new_trapping_tvs (ic_wanted imp)
-           ; unless (isEmptyBag cts || ic_no_eqs imp) $
+           ; when (not (isEmptyBag cts) && not (ic_no_eqs imp)) $
              Nothing
-                 -- Don't float out past local equalities
-                 -- C.f GHC.Tc.Solver.approximateWC
+                 -- If there are some constraints to float out, but we can't
+                 -- because we don't float out past local equalities
+                 -- (c.f GHC.Tc.Solver.approximateWC), then fail
            ; return cts }
       where
         new_trapping_tvs = trapping_tvs `extendVarSetList` ic_skols imp
@@ -215,7 +218,7 @@ floatKindEqualities wc = float_wc emptyVarSet wc
 When kind checking a type signature, we like to fail fast if we can't
 solve all the kind equality constraints: see Note [Fail fast on kind
 errors].  But what about /local/ type signatures, mentioning in-scope
-type varaibles for which there might be given equalities.  Here's
+type variables for which there might be given equalities.  Here's
 an example (T15076b):
 
   class (a ~ b) => C a b
@@ -275,7 +278,7 @@ So here's the plan:
 
 * Note that this float-and-promote step means that anonymous
   wildcards get floated to top level, as we want; see
-  Note [Checking partial type signatures] in GHC.Tc.Geh.HsType.
+  Note [Checking partial type signatures] in GHC.Tc.Gen.HsType.
 
 All this is done:
 


=====================================
utils/haddock
=====================================
@@ -1 +1 @@
-Subproject commit 5ec817a3e41b7eaa50c74701ab2d7642df86464c
+Subproject commit 20bf93490b37c0410d85a0ad4d38f9ddc2253589



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f767c28518319c471f432c2f45fe6661bf2d255e...8095fb16c3d98a4a1d3165d82ac0f2af689481dd

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f767c28518319c471f432c2f45fe6661bf2d255e...8095fb16c3d98a4a1d3165d82ac0f2af689481dd
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200424/1d454c84/attachment-0001.html>


More information about the ghc-commits mailing list