[GHC] #15552: Infinite loop/panic with an existential type.

GHC ghc-devs at haskell.org
Wed Aug 22 10:38:59 UTC 2018


#15552: Infinite loop/panic with an existential type.
-------------------------------------+-------------------------------------
        Reporter:  howtonotwin       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:  TypeInType,
                                     |  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14723            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 It's not #15473.  Something to do with zonking the type in `tcyFamInstEqn`
 {{{
 tcTyFamInstEqn fam_tc mb_clsinfo
     (L loc (HsIB { hsib_ext = tv_names
                  , hsib_body = FamEqn { feqn_tycon  = L _ eqn_tc_name
                                       , feqn_pats   = pats
                                       , feqn_rhs    = hs_ty }}))
   = ASSERT( getName fam_tc == eqn_tc_name )
     setSrcSpan loc $
     tcFamTyPats fam_tc mb_clsinfo tv_names pats
                 (kcTyFamEqnRhs mb_clsinfo hs_ty) $
                     \tvs pats res_kind ->
     do { traceTc "tcTyFamInstEqn {" (ppr eqn_tc_name <+> ppr pats)
        ; rhs_ty <- solveEqualities $ tcCheckLHsType hs_ty res_kind
        ; traceTc "tcTyFamInstEqn 1" (ppr eqn_tc_name <+> ppr pats)
        ; (ze, tvs') <- zonkTyBndrsX emptyZonkEnv tvs
        ; traceTc "tcTyFamInstEqn 2" (ppr eqn_tc_name <+> ppr pats)
        ; pats'      <- zonkTcTypeToTypes ze pats
        ; traceTc "tcTyFamInstEqn 3" (ppr eqn_tc_name <+> ppr pats $$ ppr
 rhs_ty)
        ; rhs_ty'    <- zonkTcTypeToType ze rhs_ty
        ; traceTc "tcTyFamInstEqn 4" (ppr fam_tc <+> pprTyVars tvs')
        ; return (mkCoAxBranch tvs' [] pats' rhs_ty'
 }}}
 We get to "3" but not to "4".

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


More information about the ghc-tickets mailing list