diff options
-rw-r--r-- | compiler/typecheck/TcInteract.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T10031.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
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, ['']) |