[GHC] #14111: strange error when using data families with levity polymorphism and unboxed sums and data families

GHC ghc-devs at haskell.org
Tue Aug 22 16:03:39 UTC 2017


#14111: strange error when using data families with levity polymorphism and unboxed
sums and data families
-------------------------------------+-------------------------------------
        Reporter:  carter            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 I don't think you mean

 > Instantiate the head shape with fresh unification variables

 I think you meant

 * Instantiate the return type with fresh unification variables

 That is, we don't want the unification variables in the head shape (that
 is, type patterns), but in the data constructor type.

 Actually, we already do your version of instantiation, in kind checking.
 See `TcTyClsDecls.kcDataDefn` and `TcTyClsDefls.tc_fam_ty_pats`. But we
 don't want to do it ''again'' when checking data constructors.

 If I understand correctly, this instantiate-and-unify would replace the
 call to `tcMatchTy` in `rejigConRes`. The kind coercion is easy to
 dispatch: it will always be reflexive, because the kind of a fully-applied
 tycon is always `Type`. This always-reflexive property doesn't mean the
 unification is useless, of course, as it will unify metavariables.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14111#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list