[GHC] #12522: GHC 8.0.1 hangs, looping forever in type-checker

GHC ghc-devs at haskell.org
Wed Oct 5 18:24:32 UTC 2016


#12522: GHC 8.0.1 hangs, looping forever in type-checker
-------------------------------------+-------------------------------------
        Reporter:  clinton           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash                              |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Replying to [comment:11 simonpj]:
 > Question: why do we use pre-unification when matching the RHS
 > in the injectivity-improvement step.  That's what is causing the
 > trouble.

 This all looks like reasonable behavior to me on a line-by-line basis.
 Obviously a loop is bad, but each step along the way is OK.

 We use pre-unification here because we want to match the pattern `Maybe
 (TF (x, a))` against `Maybe Char`. And indeed we should, because
 injectivity tells us that the equation `TF (D1 x, a) = Maybe (TF (x, a))`
 must be the one used to produce `Maybe Char`. (In fact, the solver should
 also generate `[W] TF (x, a) ~ Char`. Or maybe it should be Derived. Does
 it?) So I like the use of pre-unification here.

 What I find strange is that we're using the model when triggering
 improvement as we're looking at a Wanted. Doesn't the model (that is, all
 the Derived constraints) live off in its own world with minimal
 interaction with Wanteds?

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


More information about the ghc-tickets mailing list