[GHC] #10079: Coercible solver regression: Couldn't match rep of () with Const () b
GHC
ghc-devs at haskell.org
Fri Mar 13 15:17:48 UTC 2015
#10079: Coercible solver regression: Couldn't match rep of () with Const () b
-------------------------------------+-------------------------------------
Reporter: glguy | Owner: goldfire
Type: bug | Status: new
Priority: high | Milestone: 7.10.1
Component: Compiler (Type | Version: 7.10.1-rc1
checker) | Keywords:
Resolution: | Architecture:
Operating System: Unknown/Multiple | Unknown/Multiple
Type of failure: GHC rejects | Test Case: indexed-
valid program | types/should_compile/T10079
Blocked By: | Blocking:
Related Tickets: #7788, #8550 | Differential Revisions: Phab:D653
-------------------------------------+-------------------------------------
Comment (by simonpj):
> Before Phab:D653, this case was handled by the `rec_nts` trick -- a
newtype could be unwrapped only once. The problem with this trick is that
it makes type inference a little wonky: canonicalization wasn't
idempotent! For example, canonicalizing `Coercible skolem A` would get you
`Coercible skolem [A]`.
I don't agree. Looking at HEAD, I see
{{{
can_eq_nc' rdr_env envs ev ReprEq ty1 _ ty2 ps_ty2
| Just (co, ty1') <- tcTopNormaliseNewTypeTF_maybe envs rdr_env ty1
= can_eq_newtype_nc rdr_env ev NotSwapped co ty1 ty1' ty2 ps_ty2
}}}
This case simply won't fire on `Coercible skolem [A]`. The HEAD does not
aggressively unwrap newtypes deep inside types, only immediately under a
`Coercible`. And that's what we should do in the new version too.
Simon
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10079#comment:24>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list