[commit: ghc] master: Clarify comments around dropping Derived constraints (1845d1b)

git at git.haskell.org git at git.haskell.org
Mon Apr 2 02:44:17 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/1845d1bce2e4edea4f5cc9de0d46631369268212/ghc

>---------------------------------------------------------------

commit 1845d1bce2e4edea4f5cc9de0d46631369268212
Author: Richard Eisenberg <rae at cs.brynmawr.edu>
Date:   Sat Mar 17 01:57:28 2018 -0400

    Clarify comments around dropping Derived constraints
    
    [skip ci]


>---------------------------------------------------------------

1845d1bce2e4edea4f5cc9de0d46631369268212
 compiler/typecheck/TcRnTypes.hs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs
index f0439a6..6c221b7 100644
--- a/compiler/typecheck/TcRnTypes.hs
+++ b/compiler/typecheck/TcRnTypes.hs
@@ -1981,7 +1981,7 @@ isDroppableCt ct
        = definitely_insoluble  -- Keep only definitely insoluble
        | otherwise
        = case orig of
-           KindEqOrigin {} -> True    -- Why?
+           KindEqOrigin {} -> True    -- See Note [Dropping derived constraints]
 
            -- See Note [Dropping derived constraints]
            -- For fundeps, drop wanted/wanted interactions
@@ -2031,6 +2031,9 @@ But (tiresomely) we do keep *some* Derived constraints:
  * Insoluble kind equalities (e.g. [D] * ~ (* -> *)), with
    KindEqOrigin, may arise from a type equality a ~ Int#, say.  See
    Note [Equalities with incompatible kinds] in TcCanonical.
+   These need to be kept because the kind equalities might have different
+   source locations and hence different error messages.
+   E.g., test case dependent/should_fail/T11471
 
  * We keep most derived equalities arising from functional dependencies
       - Given/Given interactions (subset of FunDepOrigin1):



More information about the ghc-commits mailing list