[GHC] #13943: Compiler infinite loop with GHC-8.2
GHC
ghc-devs at haskell.org
Tue Oct 3 13:45:22 UTC 2017
#13943: Compiler infinite loop with GHC-8.2
-------------------------------------+-------------------------------------
Reporter: vagarenko | Owner: dfeuer
Type: bug | Status: new
Priority: high | Milestone: 8.2.3
Component: Compiler | Version: 8.2.1-rc3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #12791 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones <simonpj@…>):
In [changeset:"a8fde1831f4b99885b8ed444f9cd7dffd9252150/ghc" a8fde18/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="a8fde1831f4b99885b8ed444f9cd7dffd9252150"
Fix bug in the short-cut solver
Trac #13943 showed that the relatively-new short-cut solver
for class constraints (aka -fsolve-constant-dicts) was wrong.
In particular, see "Type families" under Note [Shortcut solving]
in TcInteract.
The short-cut solver recursively solves sub-goals, but it doesn't
flatten type-family applications, and as a result it erroneously
thought that C (F a) cannot possibly match (C 0), which is
simply untrue. That led to an inifinte loop in the short-cut
solver.
The significant change is the one line
+ , all isTyFamFree preds -- See "Type families" in
+ -- Note [Shortcut solving]
but, as ever, I do some other refactoring. (E.g. I changed the
name of the function to shortCutSolver rather than the more
generic trySolveFromInstance.)
I also made the short-cut solver respect the solver-depth limit,
so that if this happens again it won't just produce an infinite
loop.
A bit of other refactoring, notably moving isTyFamFree
from TcValidity to TcType
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13943#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list