Commit cecf036f authored by eir@cis.upenn.edu's avatar eir@cis.upenn.edu

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
parent 0af1b73e
......@@ -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
......
{-# 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
......@@ -441,3 +441,4 @@ test('T9939', normal, compile, [''])
test('T9973', normal, compile, [''])
test('T9971', normal, compile, [''])
test('T9999', normal, compile, [''])
test('T10031', normal, compile, [''])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment