[GHC] #15215: GHC HEAD internal error when FlexibleContexts isn't enabled
GHC
ghc-devs at haskell.org
Fri Jun 15 11:12:50 UTC 2018
#15215: GHC HEAD internal error when FlexibleContexts isn't enabled
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: Compiler (Type | Version: 8.4.3
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash or panic | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones <simonpj@…>):
In [changeset:"2f6069ccf21d7be0e09016896238f417d2492ffa/ghc" 2f6069c/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="2f6069ccf21d7be0e09016896238f417d2492ffa"
Make better "fake tycons" in error recovery
Consider (Trac #15215)
data T a = MkT ...
data S a = ...T...MkT....
If there is an error in the definition of 'T' we add a
"fake type constructor" to the type environment, so that we
can continue to typecheck 'S'. But we /were not/ adding
a fake anything for 'MkT' and so there was an internal
error when we met 'MkT' in the body of 'S'.
The fix is to add fake tycons for all the 'implicits' of 'T'.
This is done by mk_fake_tc in TcTyClsDecls.checkValidTyCl,
which now returns a /list/ of TyCons rather than just one.
On the way I did some refactoring:
* Rename TcTyDecls.tcAddImplicits to tcAddTyConsToGblEnv
and make it /include/ the TyCons themeselves as well
as their implicits
* Some incidental refactoring about tcRecSelBinds. The main
thing is that I've avoided creating a HsValBinds that we
immediately decompose. That meant moving some deck chairs
around.
NB: The new error message for the regression test T15215
has the opaque error "Illegal constraint in a type:", flagged
in Trac #14845. But that's the fault of the latter ticket.
The fix here not to blame.
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15215#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list