[GHC] #10182: lookupIfaceGlobal crash with SOURCE import
GHC
ghc-devs at haskell.org
Wed Apr 22 08:59:02 UTC 2015
#10182: lookupIfaceGlobal crash with SOURCE import
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: ezyang
Type: bug | Status: patch
Priority: normal | Milestone: 7.12.1
Component: Compiler | Version: 7.8.4
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
| https://phabricator.haskell.org/D860
-------------------------------------+-------------------------------------
Comment (by nomeata):
With Edwards’s change to the test case to not do a self-SOURCE-import, but
rather indirected through another module, we get:
{{{
*** Core Lint errors : in result of Simplifier ***
T8743.hs-boot:3:10: warning:
[RHS of $fxToRowMaybe :: forall a_anp. ToRow (Maybe a_anp)]
idArity 1 exceeds typeArity 0: $fxToRowMaybe
}}}
The error message is misleading: It occurs when compiling `T8743.hs`
proper. The desugared code before optimization is fine, after it occurs.
My guess is that still from compiling `T8740.hs-boot`, GHC has `ToRow` in
its environment as an abstract data type, without the information that it
is just a newtype around `a -> [()]`. This is used by the renamer when
parsing `T8740.hs`, so `typeArity`, which looks at the `DataTypCon`,
returns `0` instead of `1`.
Rough guess: The renamer should use the `T8743.hs`’s definition of
`ToRow`, even if a (less useful) definition is already known from a boot
file.
Edward, does this explanation help you hunt down the problem? I know
little about the plumbing of the various environments and such.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10182#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list