[commit: ghc] wip/rae: Consider equality contexts exotic, uninferrable by "deriving" (9b22b72)

git at git.haskell.org git at git.haskell.org
Thu Dec 18 04:33:22 UTC 2014


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

On branch  : wip/rae
Link       : http://ghc.haskell.org/trac/ghc/changeset/9b22b72bbf5a83a99b0ea998f0aa3b3d4d7fb79a/ghc

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

commit 9b22b72bbf5a83a99b0ea998f0aa3b3d4d7fb79a
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Tue Dec 16 17:15:49 2014 -0500

    Consider equality contexts exotic, uninferrable by "deriving"
    
    See comments in #8984. This takes back the fix for #6088.


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

9b22b72bbf5a83a99b0ea998f0aa3b3d4d7fb79a
 compiler/typecheck/TcValidity.hs                                      | 4 +---
 testsuite/tests/indexed-types/should_compile/all.T                    | 1 -
 .../tests/indexed-types/{should_compile => should_fail}/T6088.hs      | 0
 testsuite/tests/indexed-types/should_fail/all.T                       | 1 +
 4 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs
index 8575cf8..ca8b63a 100644
--- a/compiler/typecheck/TcValidity.hs
+++ b/compiler/typecheck/TcValidity.hs
@@ -878,10 +878,8 @@ validDerivPred :: TyVarSet -> PredType -> Bool
 validDerivPred tv_set pred
   = case classifyPredType pred of
        ClassPred _ tys       -> check_tys tys
-                  -- EqPred ReprEq is a Coercible constraint; treat
-                  -- like a class
-       EqPred ReprEq ty1 ty2 -> check_tys [ty1, ty2]
        TuplePred ps          -> all (validDerivPred tv_set) ps
+       EqPred {}             -> False  -- reject equality constraints
        _                     -> True   -- Non-class predicates are ok
   where
     check_tys tys = hasNoDups fvs
diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T
index ae15c27..928a70d 100644
--- a/testsuite/tests/indexed-types/should_compile/all.T
+++ b/testsuite/tests/indexed-types/should_compile/all.T
@@ -194,7 +194,6 @@ test('T6152',
      run_command,
      ['$MAKE -s --no-print-directory T6152'])
 
-test('T6088', normal, compile, [''])
 test('T7082', normal, compile, [''])
 
 test('Overlap1', normal, compile, [''])
diff --git a/testsuite/tests/indexed-types/should_compile/T6088.hs b/testsuite/tests/indexed-types/should_fail/T6088.hs
similarity index 100%
rename from testsuite/tests/indexed-types/should_compile/T6088.hs
rename to testsuite/tests/indexed-types/should_fail/T6088.hs
diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T
index 93085af..fd4001a 100644
--- a/testsuite/tests/indexed-types/should_fail/all.T
+++ b/testsuite/tests/indexed-types/should_fail/all.T
@@ -131,3 +131,4 @@ test('BadSock', normal, compile_fail, [''])
 test('T9580', normal, multimod_compile_fail, ['T9580', ''])
 test('T9662', normal, compile_fail, [''])
 test('T7862', normal, compile_fail, [''])
+test('T6088', normal, compile_fail, [''])



More information about the ghc-commits mailing list