
#10079: Coercible solver regression: Couldn't match rep of () with Const () b -------------------------------------+------------------------------------- Reporter: glguy | Owner: goldfire Type: bug | Status: merge Priority: highest | 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: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): I'm not sure this is right yet. '''First''' * For some reason `can_eq_nc'` only calls `can_eq_wanted_app` in the wanted/derived case. * That means that `try_decompose_app` cannot assume that its arg types are flattened. But `try_decompose_nom_app` and `try_decompose_repr_app` seem to assume that the type ''is'' flattened. The simple thing would be to rename `can_eq_wanted_app` to `can_eq_app`, and call it in all cases. '''Second'''. In your new `try_decompose_repr_app` you fail if either is an `AppTy`. But what about {{{ f a ~R g f a }}} where `g` flattens to `N`, a newtype {{{ newtype N f a = MkN (f a) }}} Then the flattened version will be {{{ f a ~R N f a }}} and that is certainly soluble. '''Third'''. What about {{{ a ~ f a }}} where `f` flattens to `N2` and {{{ newtype N2 a = MkN2 a }}} At the moment we will miss this altogether. We want an invariant that a representational `CTyEqCan` has a right-hand side that is not a newtype application. And we need to ensure that the invariant holds. So this really doesn't look good yet. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10079#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler