summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2015-01-27 11:40:26 -0500
committerRichard Eisenberg <eir@cis.upenn.edu>2015-01-27 14:18:29 -0500
commitcecf036fa10830a5e9861d1e6a2f8c22059fb4bb (patch)
tree1f5900d06e2760733ac3e1accf4e72b848bb4a2b
parent0af1b73e10ccb232af568cda5acf59e5ab1eaa85 (diff)
downloadhaskell-cecf036fa10830a5e9861d1e6a2f8c22059fb4bb.tar.gz
Fix #10031 by inverting a critical test in kick_out.
Summary: The documentation (Note [The flattening story] in TcFlatten) was correct; it's just the implementation that was not. Test in typecheck/should_compile/T10031 Test Plan: validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D630 GHC Trac Issues: #10031
-rw-r--r--compiler/typecheck/TcInteract.hs2
-rw-r--r--testsuite/tests/typecheck/should_compile/T10031.hs5
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
3 files changed, 7 insertions, 1 deletions
diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs
index 18ca2709fa..aef934c86d 100644
--- a/compiler/typecheck/TcInteract.hs
+++ b/compiler/typecheck/TcInteract.hs
@@ -1126,7 +1126,7 @@ kick_out new_flavour new_eq_rel new_tv (IC { inert_eqs = tv_eqs
| can_rewrite ev
= case eq_rel of
NomEq -> not (rhs_ty `eqType` mkTyVarTy new_tv)
- ReprEq -> isTyVarExposed new_tv rhs_ty
+ ReprEq -> not (isTyVarExposed new_tv rhs_ty)
| otherwise
= True
diff --git a/testsuite/tests/typecheck/should_compile/T10031.hs b/testsuite/tests/typecheck/should_compile/T10031.hs
new file mode 100644
index 0000000000..4ed45d350e
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T10031.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+module T10031 where
+import Data.Coerce
+coerce' :: Coercible b a => a -> b
+coerce' = coerce (\x -> x :: b) :: forall a b. Coercible b a => a -> b
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index c292eaf1d9..4348ea3a78 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -441,3 +441,4 @@ test('T9939', normal, compile, [''])
test('T9973', normal, compile, [''])
test('T9971', normal, compile, [''])
test('T9999', normal, compile, [''])
+test('T10031', normal, compile, [''])