[GHC] #11197: Overeager deferred type errors
GHC
ghc-devs at haskell.org
Fri Dec 11 15:29:12 UTC 2015
#11197: Overeager deferred type errors
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: goldfire
Type: bug | Status: new
Priority: normal | Milestone: 8.0.1
Component: Compiler | Version: 7.11
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
With `TypeInType`, the solver now works in terms of unlifted equality. The
only place this matters is in deferred type errors, which now are more
eager than they were before. For example:
{{{
{-# OPTIONS_GHC -fdefer-type-errors #-}
module Main where
main = do
putStrLn "Hi there."
putStrLn True
}}}
This used to print
{{{
Hi there.
Defer: Defer.hs:7:12: error:
...
}}}
Now it prints
{{{
Defer: Defer.hs:7:12: error:
...
}}}
No more `Hi there.`.
Thinking about Core, this change should be expected. GHC puts all evidence
bindings for `main` at the top, and with unlifted equality in the solver,
these bindings now contain `case typeError ... of ...`, which forces the
type error eagerly. Previously, there was a lazy binding for a lifted
equality witness, unpacked only at the last moment by magic in the
desugarer, thus the lazier warning.
Simon has proposed customizing the !FloatIn pass to deal with this
scenario. I do believe this would work nicely, but I have not yet
implemented it.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11197>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list